C# asp.net 下载文件到本机固定目录,不要那种IE下载打开保存对话框的!
2个回答
展开全部
如果是windows系统加C#语言就没这么麻烦,直接判断当前安装的程序
下面的这个哈西表保存了当前安装的程序
Hashtable programs = new Hashtable();
private void steupList()
{
try
{
int i = 0;
Microsoft.Win32.RegistryKey lmKey, uninstallKey, programKey;
lmKey = Microsoft.Win32.Registry.LocalMachine;
uninstallKey = lmKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
string[] programKeys = uninstallKey.GetSubKeyNames();
foreach (string keyName in programKeys)
{
i++;
programKey = uninstallKey.OpenSubKey(keyName);
if (programKey.GetValue("DisplayName") == null)
continue;
string one = programKey.GetValue("DisplayName").ToString();
programs.Add(i.ToString(), one);
programKey.Close();
}
uninstallKey.Close();
lmKey.Close();
}
catch (Exception e)
{
//MessageBox.Show(e.Message);
}
}
如果安装了就用process类执行这个进程,没有安装就用process类调用这个的安装程序就可
下面的这个哈西表保存了当前安装的程序
Hashtable programs = new Hashtable();
private void steupList()
{
try
{
int i = 0;
Microsoft.Win32.RegistryKey lmKey, uninstallKey, programKey;
lmKey = Microsoft.Win32.Registry.LocalMachine;
uninstallKey = lmKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
string[] programKeys = uninstallKey.GetSubKeyNames();
foreach (string keyName in programKeys)
{
i++;
programKey = uninstallKey.OpenSubKey(keyName);
if (programKey.GetValue("DisplayName") == null)
continue;
string one = programKey.GetValue("DisplayName").ToString();
programs.Add(i.ToString(), one);
programKey.Close();
}
uninstallKey.Close();
lmKey.Close();
}
catch (Exception e)
{
//MessageBox.Show(e.Message);
}
}
如果安装了就用process类执行这个进程,没有安装就用process类调用这个的安装程序就可
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询