[英]Can't log to Skype when I use Process.Start
The problem that I have is that when I try to open Skype using Process.start in C#, the Skype window opens but when I put the user and password, I can't log on.我遇到的问题是,当我尝试在 C# 中使用 Process.start 打开 Skype 时,Skype 窗口会打开,但是当我输入用户名和密码时,我无法登录。 But when i go directly to "C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe" and I choose "Run as different user" (Shift + right clic),the Skype window opens, I put the credentials and in that case it works.
但是,当我直接转到“C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe”并选择“以不同用户身份运行”(Shift + 右键单击)时,Skype 窗口打开,我输入凭据并在这种情况下,它有效。
In Windows I have logged in, as local user and the user I need to run Skype is a Domain user.在 Windows 中,我以本地用户身份登录,我需要运行 Skype 的用户是域用户。 The connection to skype is through proxy.
与 Skype 的连接是通过代理进行的。
I have checked in task manager, and the process starts with the correct user but somehow the behavior is different when I do it right clicking the folder and from the Process.start.我已经检查了任务管理器,并且该过程以正确的用户开始,但不知何故,当我右键单击文件夹和从 Process.start 执行此操作时,行为会有所不同。
Here is my code:这是我的代码:
ProcessStartInfo oPi = new ProcessStartInfo();
oPi.Domain = "Domain";
oPi.UserName = "User";
oPi.Password = oSecureString;
oPi.FileName = "C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe";
oPi.UseShellExecute = false;
Process oP = Process.Start(oPi);
Just put the code in the button's click event handler and use using System.Diagnostics
as namespace to get Process
:只需将代码放在按钮的点击事件处理程序中,并使用
using System.Diagnostics
作为命名空间来获取Process
:
protected void btn_Click(object sender, EventArgs e)
{
try
{
Process.Start("C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe");
}
catch (Exception ex)
{
Response.Write("" + ex);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.