如何打开Msteams从Winforms应用程序向用户发送消息(CHAT)?

发布于 2025-02-09 20:18:48 字数 420 浏览 1 评论 0原文

private void ContactDataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
{
    if (e.ColumnIndex == 2) // Assuming it's the first column
    {
        Process.Start("mailto:" + 
            ContactDataGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
    }
}

这是我的代码,将电子邮件超链接添加到我的DataGridView。该电子邮件取自文本框。我想做同样的事情,将联系人输入文本框中,然后可以单击此超链接以打开Microsoft团队以及联系人。

这可能吗?

private void ContactDataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
{
    if (e.ColumnIndex == 2) // Assuming it's the first column
    {
        Process.Start("mailto:" + 
            ContactDataGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
    }
}

This is my code to add an email hyperlink to my datagridview. The email is taken from a textbox. I would like to do the same where I would enter a contact into a textbox and can then click this hyperlink to open up Microsoft Teams along with the contact.

Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

灰色世界里的红玫瑰 2025-02-16 20:18:48

您可以使用msteams: url方案类似:

Process.Start("msteams:l/chat/0/[email protected]&message=Hello")

然后,它可以打开Microsoft团队,并使用草稿消息准备发送给用户。

您可以在此处找到文档:

我只是用<<代码> msteam: URL方案。

You can use msteams: url scheme like this:

Process.Start("msteams:l/chat/0/[email protected]&message=Hello")

Then it opens Microsoft Teams with a draft message ready to send to the user.

You can find the documentations here:

I just replaced the web URL with msteam: url scheme.

我的奇迹 2025-02-16 20:18:48

我想您要使用 graplapapi 用于Microsoft Teams,因此您可以操纵您的应用程序与Microsoft团队聊天,频​​道和连接以及许多其他

最好的

I suppose you to use GraphAPI for Microsoft teams so you manipulate your application with Microsoft Teams chats, channels and connections and many else

Best

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文