- UID
- 1494
- 积分
- 0
- TBS
- 676
- 智商
- 725
- 节操
- 719
- 海贝
- 0
- 阅读权限
- 0
- 在线时间
- 1 小时
- 注册时间
- 2014-1-10
- 最后登录
- 2014-1-13
|
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;
}
}
}
|
评分
-
参与人数 1 | TBS +5 |
节操 +5 |
智商 +5 |
收起
理由
|
骚浪贱
| + 5 |
+ 5 |
+ 5 |
希望日后继续写这种软件为大家造福. |
查看全部评分
|