以下是实现QQ自动登录的核心代码!也不是很神秘,就是启动QQ进程的时候应该传入QQ程序的路径,用户号码以及密码,记住,密码是加密形式的! 不多说了,直接贴代码更加直接using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; namespace QouShui.DLL.Logins { /// <summary> /// 登录QQ /// </summary> public class ClassQQ { public static void Login(string qq, string id, string pwd) { Process pro = new Process(); string s = " /start QQUIN:" + id; s += " PWDHASH:" + Hash(pwd) + " /STAT:41 /EMB_HWND:0 /NOAUTOSCAN"; pro.StartInfo.Arguments = s; pro.StartInfo.FileName = qq; pro.Start(); pro.WaitForExit(5000); } static string Hash(string pwd) { return HashBase64(pwd); } /// <summary> /// 返回指定字符串以Base64编码的哈希值 /// </summary> /// <param name="str">要计算哈希值的字符串</param> /// <returns></returns> public static string HashBase64(string str) { byte[] result = new byte[str.Length]; try { MD5 md = new MD5CryptoServiceProvider(); result = md.ComputeHash(System.Text.Encoding.UTF8.GetBytes(str)); return Convert.ToBase64String(result); } catch { return ""; } } } } 说白了,就是构造启动进程的传输!