聲明API函數
private void toolStripSplitButton1_ButtonClick(object sender, EventArgs e)
{
string qq = GetRandomQQ();
ShellExecute((int)this.Handle, "open", "tencent://message/?uin=" + qq, "", "", 1);
}
[DllImport("shell32.dll ", EntryPoint = "ShellExecute")]
public static extern int ShellExecute(
int hwnd,
string lpOperation,
string lpFile,
string lpParameters,
string lpDirectory,
int nShowCmd);
參數QQ爲任意存在號碼
以上代碼僅供參考