国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

驗證本機的excel版本的C#代碼

2020-01-24 03:42:59
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:

/// <summary>
/// 安裝的excel的版本,0為沒有安裝,大于1說明安裝了多個.
/// </summary>
/// <returns></returns>
public static List<string> ExcelVersion()
{
List<string> list = new List<string>();
List<string> lisemp = new List<string>();
List<string> listvison = new List<string>();
RegistryKey rk = Registry.LocalMachine;
RegistryKey akey = rk.OpenSubKey(@"SOFTWARE//Microsoft//Office");
RegistryKey csk;
string str;
Hashtable hash = new Hashtable();
string[] ss = akey.GetSubKeyNames();
foreach (string s in ss)
{
string strem = @"SOFTWARE//Microsoft//Office" + @"http://" + s;
csk = rk.OpenSubKey(strem);
string[] csd = csk.GetSubKeyNames();
foreach (string sk in csd)
{
if (sk == "Excel")
{
str = strem + @"http://" + "Excel";
list.Add(str);
lisemp.Add(s);
}
}
}
if (list != null)
{
for (int index = 0; index < list.Count; index++)
{
list[index] = list[index] + @"http://InstallRoot//";
RegistryKey f = rk.OpenSubKey(list[index]);
if (f != null)
{
listvison.Add(lisemp[index]);
}
}
}
return listvison;
}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 博湖县| 德昌县| 泸水县| 峨边| 和政县| 油尖旺区| 朝阳区| 柘城县| 招远市| 绵阳市| 辽宁省| 徐闻县| 镇江市| 泌阳县| 江门市| 桂东县| 滨海县| 容城县| 冕宁县| 磐安县| 浮山县| 志丹县| 石首市| 宽甸| 湾仔区| 宜阳县| 安国市| 宝清县| 县级市| 伊春市| 明水县| 开封市| 大埔县| 南郑县| 商洛市| 长顺县| 新河县| 嵊州市| 新龙县| 阜南县| 泰安市|