none
如何通过Process传递用户名和密码 RRS feed

  • 问题

  • 在C#中我想把用户名和密码传递给QQ可是失败了,不知什么原因,请指教.谢谢.代码如下:

    ...........

    string pwd = textBox1.Text;
                SecureString sspwd = new SecureString();
                for (int i = 0; i < pwd.Length; i++)
                {
                    sspwd.AppendChar(pwd [i]);

                }
                          ProcessStartInfo psInfo = new ProcessStartInfo();
                psInfo.Password = sspwd;
                psInfo.UserName = comboBox1.Text;
                psInfo.FileName = @"E:\winxp\Program Files\Tencent\QQ\Bin\QQ.exe";
                psInfo.UseShellExecute =false ;
                psInfo.WorkingDirectory = @"E:\winxp\Program Files\Tencent\QQ\Bin\";
                Process proc = new Process();
                proc.StartInfo = psInfo;
                proc.Start();
    ................


    VC# ASP.NET
    2010年4月16日 14:24

答案

全部回复