感谢safetyOtter,我刚刚添加了此代码来解决问题:
string key = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\localhost"; RegistryKey localhost = Registry.CurrentUser.CreateSubKey(key); localhost.SetValue("http", 1);