简体   繁体   English

使用 Process.Start 时无法登录 Skype

[英]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.

相关问题 csharpcodeprovider:不能使用Process.Start() - csharpcodeprovider: Can't use Process.Start() 为什么我不能使用 Process.Start 启动 Robocopy - Why i can't launch Robocopy with Process.Start Process.Start()何时可以返回null? - When can Process.Start() return null? 当我使用Process.Start运行python程序时,我的python程序中的日志不起作用吗? - When I run a python program using Process.Start the log in my python program does not work? 为什么在使用process.start(“ regedit.exe”)时看不到“ wow6432node”? - Why I can't see 'wow6432node' when using process.start(“regedit.exe”)? 调试时无法使用 Process.Start() 执行进程 - Can't execute a process using Process.Start() while debugging 如何使用 c# 运行 exe 文件(我不能使用 Process.Start() 因为我不知道 exe 文件的位置) - How can I run an exe file with c# (I can't use Process.Start() because I don't know the exe file's location) 使用Process.Start运行程序时,它无法找到它的资源文件 - When running a program using Process.Start, it can't find it's resource files 当我使用Process.Start()运行该程序时,如何强制另一个程序不显示任何对话框 - How can I force another program to not show any dialog when I run it with Process.Start() 当我使用Process.Start()时,为什么我的应用程序启动时间会变慢? - Why is my application startup time slower when I use Process.Start()?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM