实现效果:
知识运用:
Default Download Directory键
实现代码:
private void button2_Click(object sender, EventArgs e) { try { RegistryKey regMain = Registry.CurrentUser; RegistryKey regChild = regMain.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main"); regChild.SetValue("Default Download Directory", textBox1.Text, RegistryValueKind.String); MessageBox.Show("设置默认下载路径成功"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
原文地址:https://www.cnblogs.com/feiyucha/p/10344486.html
时间: 2024-10-09 07:39:02