求助,请问如果把已有的注册表代码用C#代码写入注册表? 注册表C#写注册表C#C#读写注册表 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将上面的两段保存为两个.reg的文件Process.Start("regedit", "/s " + 你的reg文件) Process.Start("regedit", "/s " + 你的reg文件);不是告诉你了么 项目这块不能有外部文件调用,能帮我看看下面的转换代码有没有问题吗?禁用reg文件:Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ACPI\Parameters]"AMLIMaxCTObjs"=hex:04,00,00,00"Attributes"=dword:00000070[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ACPI\Parameters\WakeUp]"FixedEventMask"=hex:20,05"FixedEventStatus"=hex:00,84"GenericEventMask"=hex:18,50,00,10"GenericEventStatus"=hex:10,00,ff,00 RegistryKey key = Registry.LocalMachine; RegistryKey parameters = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters", true); parameters.SetValue("AMLIMaxCTObjs", "hex:04,00,00,00"); parameters.SetValue("Attributes", "dword:00000070"); RegistryKey wakeUp = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters\\WakeUp", true); wakeUp.SetValue("FixedEventMask", "hex:20,05"); wakeUp.SetValue("FixedEventStatus", "hex:00,84"); wakeUp.SetValue("GenericEventMask", "hex:18,50,00,10"); wakeUp.SetValue("GenericEventStatus", "hex:10,00,ff,00"); /// <summary> /// 是否禁用XP上的待机功能或Win7上的睡眠功能 /// </summary> /// <param name="IsDisable">是否禁用</param> public void IsDisableStandby(bool IsDisable) { if (IsDisable) { //禁用 RegistryKey key = Registry.LocalMachine; RegistryKey parameters = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters", true); parameters.SetValue("AMLIMaxCTObjs", new byte[] { 0x04, 00, 00, 00 }, RegistryValueKind.Binary); parameters.SetValue("Attributes", 0x00000070, RegistryValueKind.DWord); RegistryKey wakeUp = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters\\WakeUp", true); wakeUp.SetValue("FixedEventMask", new byte[] { 0x20, 0x05 }, RegistryValueKind.Binary); wakeUp.SetValue("FixedEventStatus", new byte[] { 00, 0x84 }, RegistryValueKind.Binary); wakeUp.SetValue("GenericEventMask", new byte[] { 0x18, 0x50, 00, 0x10 }, RegistryValueKind.Binary); wakeUp.SetValue("GenericEventStatus", new byte[] { 0x10, 00, 0xFF, 00 }, RegistryValueKind.Binary); } else { //启用 RegistryKey key = Registry.LocalMachine; RegistryKey parameters = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters", true); parameters.SetValue("AMLIMaxCTObjs", new byte[] { 0x05, 00, 00, 00 }, RegistryValueKind.Binary); parameters.SetValue("Attributes", 0x00000000, RegistryValueKind.DWord); RegistryKey wakeUp = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters\\WakeUp", true); wakeUp.SetValue("FixedEventMask", new byte[] { 0x20, 0x01 }, RegistryValueKind.Binary); wakeUp.SetValue("FixedEventStatus", new byte[] { 00, 0x85 }, RegistryValueKind.Binary); wakeUp.SetValue("GenericEventMask", new byte[] { 00, 00, 00, 00, 00, 00, 00, 00 }, RegistryValueKind.Binary); wakeUp.SetValue("GenericEventStatus", new byte[] { 00, 00, 0xc3, 0x46, 00, 00, 00, 00 }, RegistryValueKind.Binary); } } 重写tabControl的onPaint方法。 SQL数据库。。。我快哭了。。。 请问:在客户端代码中怎样引入jQuery文件 C#一个简单的问题 VC#中实现数据库问题? VS.NET2003中的属性或解决方案资源管理器等一系列窗口,按小按钮后可以固定位置,或当鼠标over时才伸展出来,没有over时就自动缩加隐藏, 如何实现子窗体只能打开一次,我是新手,高手们帮帮忙好吗 设计模式 马上给分!C# Windows如何判断计算器已经打开? 如何用代码取DLL文件里的图标 C#动态类型的问题 C#在登录界面限制用户登陆次数,下面的程序哪里错了??
Process.Start("regedit", "/s " + 你的reg文件)
不是告诉你了么
禁用reg文件:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ACPI\Parameters]
"AMLIMaxCTObjs"=hex:04,00,00,00
"Attributes"=dword:00000070
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ACPI\Parameters\WakeUp]
"FixedEventMask"=hex:20,05
"FixedEventStatus"=hex:00,84
"GenericEventMask"=hex:18,50,00,10
"GenericEventStatus"=hex:10,00,ff,00 RegistryKey key = Registry.LocalMachine;
RegistryKey parameters = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters", true);
parameters.SetValue("AMLIMaxCTObjs", "hex:04,00,00,00");
parameters.SetValue("Attributes", "dword:00000070"); RegistryKey wakeUp = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters\\WakeUp", true);
wakeUp.SetValue("FixedEventMask", "hex:20,05");
wakeUp.SetValue("FixedEventStatus", "hex:00,84");
wakeUp.SetValue("GenericEventMask", "hex:18,50,00,10");
wakeUp.SetValue("GenericEventStatus", "hex:10,00,ff,00");
/// 是否禁用XP上的待机功能或Win7上的睡眠功能
/// </summary>
/// <param name="IsDisable">是否禁用</param>
public void IsDisableStandby(bool IsDisable)
{
if (IsDisable)
{
//禁用
RegistryKey key = Registry.LocalMachine;
RegistryKey parameters = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters", true);
parameters.SetValue("AMLIMaxCTObjs", new byte[] { 0x04, 00, 00, 00 }, RegistryValueKind.Binary);
parameters.SetValue("Attributes", 0x00000070, RegistryValueKind.DWord); RegistryKey wakeUp = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters\\WakeUp", true);
wakeUp.SetValue("FixedEventMask", new byte[] { 0x20, 0x05 }, RegistryValueKind.Binary);
wakeUp.SetValue("FixedEventStatus", new byte[] { 00, 0x84 }, RegistryValueKind.Binary);
wakeUp.SetValue("GenericEventMask", new byte[] { 0x18, 0x50, 00, 0x10 }, RegistryValueKind.Binary);
wakeUp.SetValue("GenericEventStatus", new byte[] { 0x10, 00, 0xFF, 00 }, RegistryValueKind.Binary);
}
else
{
//启用
RegistryKey key = Registry.LocalMachine;
RegistryKey parameters = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters", true);
parameters.SetValue("AMLIMaxCTObjs", new byte[] { 0x05, 00, 00, 00 }, RegistryValueKind.Binary);
parameters.SetValue("Attributes", 0x00000000, RegistryValueKind.DWord); RegistryKey wakeUp = key.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\ACPI\\Parameters\\WakeUp", true);
wakeUp.SetValue("FixedEventMask", new byte[] { 0x20, 0x01 }, RegistryValueKind.Binary);
wakeUp.SetValue("FixedEventStatus", new byte[] { 00, 0x85 }, RegistryValueKind.Binary);
wakeUp.SetValue("GenericEventMask", new byte[] { 00, 00, 00, 00, 00, 00, 00, 00 }, RegistryValueKind.Binary);
wakeUp.SetValue("GenericEventStatus", new byte[] { 00, 00, 0xc3, 0x46, 00, 00, 00, 00 }, RegistryValueKind.Binary);
}
}