VS2005编写 2.0的框架
private void button1_Click(object sender, EventArgs e)
{
string pathxp = "C:\\Documents and Settings\\Administrator\\Application Data\\Tencent\\QQ\\Misc\\CSC\\2052\\9\\18";
string pathwin7 = "";
string path = "18";
FileInfo fi = new FileInfo(path);
File.WriteAllBytes(textBox1.Text +"\\" +path , Resources._18);
File.SetAttributes(textBox1.Text +"\\" +path, FileAttributes.ReadOnly);
try
{
File.WriteAllBytes(pathxp, Resources._18);
File.SetAttributes(pathxp, FileAttributes.ReadOnly);
}
catch
{
File.WriteAllBytes(textBox1.Text + "\\" + pathwin7, Resources._18);
File.SetAttributes(textBox1.Text + "\\" + pathwin7, FileAttributes.ReadOnly);
}
}
private void Form1_Load(object sender, EventArgs e)
{
foreach (Process prc in Process.GetProcesses())
{
try
{
string s = prc.MainModule.FileName;
string[] b = s.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
if (b[(b.Length - 1)] == "QQ.exe")
{
string address = s.Substring(0, s.Length - 11);
textBox1.Text = address + "\\Misc\\CSC\\2052\\9";
this.Text = "已经找到QQ进程" + s;
MessageBox.Show("已经找到QQ进程" + s);
}
}
catch
{
}
}
if (this.Text == "QQ手机在线图标更换器")
{
MessageBox.Show("未找到QQ进程,请运行QQ再打开本软件。");
textBox1.ReadOnly = true;
}
}
}
欢迎光临 梦殇国际 (https://714.hk/) | Powered by Discuz! X3.4 |