基本信息
源码名称:C# 开机清理工具源码
源码大小:0.03M
文件格式:.rar
开发语言:C#
更新时间:2019-03-18
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
开机清理工具源码,可根据自己的需要,把要终止的进珵名称加入代码中,生成执行文件进行清理。速度清理电脑垃圾,提升电脑运行速度。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.IO;
using System.Diagnostics;
namespace 开机清理工具
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
btn清理_Click(null, null);
this.timer1.Enabled = true;
}
private void btn清理_Click(object sender, EventArgs e)
{
Process[] prs = Process.GetProcesses();
foreach (Process pi in prs)
{
if (pi.ProcessName.ToLower().Contains("atieclxx")
|| pi.ProcessName.ToLower().Contains("ucmapi")
|| pi.ProcessName.ToLower().Contains("sogoucloud")
|| pi.ProcessName.ToLower().Contains("ccc")
|| pi.ProcessName.ToLower().Contains("sohunews")
|| pi.ProcessName.ToLower().Contains("jucheck"))
{
this.tbInfor.Text = pi.ProcessName "\r\n";
pi.Kill();
}
}
this.tbInfor.Text = DateTime.Now.ToString() "\r\n";
}
private void btnExist_Click(object sender, EventArgs e)
{
this.Close();
}
private void timer1_Tick(object sender, EventArgs e)
{
btn清理_Click(null, null);
}
private void btn设置本机IP_Click(object sender, EventArgs e)
{
string _ipaddress = this.tbIP.Text.Trim();
string _submask = "255.255.255.0";
string _gateway = "10.73.30.1";
//string _dns1 = "123.1.11.1";
string _doscmd = "netsh interface ip set address 本地连接 static " _ipaddress " " _submask " " _gateway " 1";
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(_doscmd.ToString());
//_doscmd = "netsh interface ip set dns 本地连接 static " _dns1;
//p.StandardInput.WriteLine(_doscmd.ToString());
p.StandardInput.WriteLine("exit");
}
private void btn自动获取IP_Click(object sender, EventArgs e)
{
string _doscmd = "netsh interface ip set address 本地连接 DHCP";
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(_doscmd.ToString());
_doscmd = "netsh interface ip set dns 本地连接 DHCP";
p.StandardInput.WriteLine(_doscmd.ToString());
p.StandardInput.WriteLine("exit");
}
}
}