实现效果:
知识运用:
Default Download Directory键
实现代码:
private void button2_Click(object sender, EventArgs e) { try { RegistryKey regMain = Registry.CurrentUser; RegistryKey regChild = regMain.CreateSubKey(@"SoftwareMicrosoftInternet ExplorerMain"); regChild.SetValue("Default Download Directory", textBox1.Text, RegistryValueKind.String); MessageBox.Show("设置默认下载路径成功"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }