您的位置:首页 > 编程语言 > C#

C# 修改注册表 达到 Windows Services 启动 窗体应用程序

2006-12-20 16:13 399 查看
在  OnStart 函数 下 添加 如下代码


            //  [HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Service1]


            //  "Type"=dword:00000110    Allow  service  to  interact  with  desktop


           //   "Type"=dword:00000010    Deny  service  to  interact  with  desktop


            Microsoft.Win32.RegistryKey key = Registry.LocalMachine;


            Microsoft.Win32.RegistryKey key1 = key.CreateSubKey("System//ControlSet001//Services//Service1");


            key1.SetValue("Type", 272, Microsoft.Win32.RegistryValueKind.DWord);

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  windows c#