: :其他软件 2019-08-10 16:30:14
此软件涉及到了C#的注册表读写既然开源,那么下方是源代码:
注册表好好玩啊,这是源代码。using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
//BY-MCtech
namespace 关闭Windows_defender
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
RegistryKey key1 = Registry.LocalMachine;
RegistryKey software1 = key1.OpenSubKey(@"SYSTEMCurrentControlSetServicesSecurityHealthService");
string GetValue1 = software1.GetValue("Start").ToString();
if(GetValue1 == "2")
{
label1.Text = "状态: 已开启!";
}
else if (GetValue1 == "3")
{
label1.Text = "状态: 已被第三方软件接管!";
}
else if (GetValue1 == "4")
{
label1.Text = "状态: 已关闭!";
}
RegistryKey key2 = Registry.LocalMachine;
RegistryKey software2 = key2.OpenSubKey(@"SYSTEMCurrentControlSetServiceswscsvc");
string GetValue2 = software2.GetValue("Start").ToString();
if (GetValue2 == "2")
{
label2.Text = "状态: 已开启!";
}
else if (GetValue2 == "4")
{
label2.Text = "状态: 已关闭!";
}
}
private void Button1_Click(object sender, EventArgs e)
{
//开启安全健康服务
RegistryKey key1 = Registry.LocalMachine;
RegistryKey software1 = key1.OpenSubKey(@"SYSTEMCurrentControlSetServicesSecurityHealthService", true);
software1.SetValue("Start",2);
string GetValue1 = software1.GetValue("Start").ToString();
if (GetValue1 == "2")
{
MessageBox.Show("开启成功!重启生效");
label1.Text = "状态: 已开启!";
}
else
{
MessageBox.Show("错误!请以管理员权限运行若仍未解决我也没办法!");
}
}
private void Button2_Click(object sender, EventArgs e)
{
//关闭安全健康服务
RegistryKey key1 = Registry.LocalMachine;
RegistryKey software1 = key1.OpenSubKey(@"SYSTEMCurrentControlSetServicesSecurityHealthService", true);
software1.SetValue("Start", 4);
string GetValue1 = software1.GetValue("Start").ToString();
if (GetValue1 == "4") {
MessageBox.Show("关闭成功!重启生效");
label1.Text = "状态: 已关闭!";
}
else { MessageBox.Show("错误!请以管理员权限运行若仍未解决我也没办法!"); }
}
private void Label1_Click(object sender, EventArgs e)
{
//安全健康服务状态
}
private void Label2_Click(object sender, EventArgs e)
{
//安全中心服务状态
}
private void Button4_Click(object sender, EventArgs e)
{
//关闭window Defender安全中心服务
RegistryKey key2 = Registry.LocalMachine;
RegistryKey software2 = key2.OpenSubKey(@"SYSTEMCurrentControlSetServiceswscsvc", true);
software2.SetValue("Start", 4);
string GetValue2 = software2.GetValue("Start").ToString();
if (GetValue2 == "4") {
MessageBox.Show("关闭成功!重启生效");
label2.Text = "状态: 已关闭!";
}
else
{
MessageBox.Show("错误!请以管理员权限运行若仍未解决我也没办法!");
}
}
private void Button3_Click(object sender, EventArgs e)
{
//开启window Defender安全中心服务
RegistryKey key2 = Registry.LocalMachine;
RegistryKey software2 = key2.OpenSubKey(@"SYSTEMCurrentControlSetServiceswscsvc", true);
software2.SetValue("Start", 2);
string GetValue2 = software2.GetValue("Start").ToString();
if (GetValue2 == "2")
{
MessageBox.Show("开启成功!重启生效");
label2.Text = "状态: 已开启!";
}
else
{
MessageBox.Show("错误!请以管理员权限运行若仍未解决我也没办法!");
}
}
private void GroupBox1_Enter(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
10-12EliteIV开发测试工具 单机锁
10-12表格小工具,很多功能没有实现
10-12有道翻译源码JS版
10-11MFC 串口开发工具
10-10PEiD 0.95 查壳工具
10-09AMIbios修改工具
10-09DTL2007 电表工具
10-11word使用绘图工具画正方体
10-04Word开发工具里面的日期选取器使用方法
08-30Powerpoint找不到控件工具怎么办
08-29excel中访问工具栏中增加相应的命令键
08-28ppt任意多边形工具的使用方法
08-28PPT如何将常用工具栏自定义在选项卡
08-27在excel中添加快速工具方法
11-26word菜单栏开发工具加载项自定义
11-26PPT添加形状运算工具