【问题标题】:Exception when checking if user is logged out检查用户是否已注销时出现异常
【发布时间】:2015-02-24 01:03:02
【问题描述】:

检查用户是否已注销时出现异常。

代码sn-p:

if(skype.CurrentUserStatus == TUserStatus.cusLoggedOut)
{
    MessageBox.Show("Bitte melde dich in Skype an.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
    System.Windows.Forms.Application.Exit();
}

但是如果我退出并尝试调试它,我会得到一个异常。

Ein Ausnahmefehler des Typs "System.Runtime.InteropServices.COMException" ist in alphasn0w.exe aufgetreten.

Zusätzliche Informationen:未附加。

翻译:

在 alphasn0w.exe 中发生了“System.Runtime.InteropServices.COMException”类型的异常。

附加信息:未附加。

我该如何解决这个问题?

【问题讨论】:

  • 哪一行导致异常?
  • 这个 SO 线程可能会提供一些关于如何调试 COM 异常的见解。这可能就像通过以管理员身份运行 VS 解决的用户权限问题一样简单。 stackoverflow.com/questions/4281425/…
  • @MikeG 第一行代码sn-p。
  • 是否有替代方法来检查用户是否已注销?
  • 第 1 行抛出的异常类型是什么?

标签: c# skype


【解决方案1】:

这意味着你没有连接到 Skype。

你会想要做的:

Skype skype = new Skype();
skype.attach(7, true);

“true”表示它将等到用户单击“允许”,然后继续执行您的代码。

【讨论】:

    猜你喜欢
    • 2012-01-13
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-27
    • 1970-01-01
    • 2012-05-19
    相关资源
    最近更新 更多