从 C# 打开 Office Communicator 会话
我正在开发 WPF 应用程序,我希望打开 sip:[电子邮件受保护] 链接。我可以使用以下代码打开 mailto 链接:
private void btnSendEmail_Click(object sender, RoutedEventArgs e)
{
try
{
string mailURL = String.Format("mailto:{0}", UserDetails.EmailAddress);
Process.Start(mailURL);
Close();
}
catch
{
// Handle exception
}
}
尽管如此,我无法以类似的方式打开 sip: 链接。我想要实现的是与用户打开一个新的聊天会话,就像我在关注 sip: 来自 Outlook 的链接时能够执行的操作一样。
有什么想法吗?
编辑:我最终使用了 CommunicatorAPI。 Messenger.InstantMessage() 似乎对我有用。更多信息请参见:http://msdn.microsoft.com/en-us/library /bb787232.aspx
I am working on a WPF application and I wish to open sip:[email protected] links. I am able to open mailto links using the following code:
private void btnSendEmail_Click(object sender, RoutedEventArgs e)
{
try
{
string mailURL = String.Format("mailto:{0}", UserDetails.EmailAddress);
Process.Start(mailURL);
Close();
}
catch
{
// Handle exception
}
}
Although, I am unable to open sip: links in a similar way. What I am trying to achieve is to open a new chat session with a user, like I am able to do when I follow sip: links from Outlook.
Any ideas?
Edit: I ended up using the CommunicatorAPI. Messenger.InstantMessage() seems to work for me. More info here: http://msdn.microsoft.com/en-us/library/bb787232.aspx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用
Process.Start
在我的系统上运行良好(使用 Microsoft Lync 2010,较新版本的 Communicator):运行上述代码会打开一个新的聊天窗口。唯一的例外是当我输入自己的用户名时,它开始为我自己撰写一封新的 Outlook 电子邮件。当您使用它时会发生什么(也许也可以尝试省略以下对
Close
的调用)。Using
Process.Start
works fine on my system (with Microsoft Lync 2010, a newer version of Communicator):Running the above code results in a new chat window opening. The only exception is when I enter my own user name, in which it starts composing a new Outlook e-mail message to myself. What happens when you use this (maybe also try omitting the following call to
Close
).您可能需要将程序与“sip”uri 方案关联起来。试试这个:如何创建自己的 URL 协议? (例如so://...)
You probably need to associate a program with the "sip" uri scheme. Try this: how do I create my own URL protocol? (e.g. so://...)
如果您安装了 Lync 或 Office Communicator,它们应该对 sip: uri 方案做出适当的响应。另外,tel:、callto: 等。作为参考,完整列表位于此处。
这对 WPF 应用程序不起作用吗?从基本的 html 页面开始,它对您有用吗?
if you have Lync or Office Communicator installed, they should respond appropriately to the sip: uri scheme. Also, tel:, callto: etc. For reference, the full list is here.
Is this not working for you from a WPF app? Does it work for you from a basic html page?
我最终使用了 CommunicatorAPI。 Messenger.InstantMessage() 似乎对我有用。更多信息请参见:http://msdn.microsoft.com/en-us/library /bb787232.aspx
I ended up using the CommunicatorAPI. Messenger.InstantMessage() seems to work for me. More info here: http://msdn.microsoft.com/en-us/library/bb787232.aspx
以下代码可能不适合您,因为您正在尝试给自己发送即时消息。
The following code probably didn't work for you because you were trying to IM yourself.