How to get Caller ID in C#?(如何在 C# 中获取来电显示?)
问题描述
我想使用 56K 调制解调器来获取拨打家庭电话的电话号码.有没有办法用 C# 实现这一点?
I want to use 56K modem for getting telephone number of who calls the home phone. Is there a way to achieve this with C# ?
推荐答案
并非所有调制解调器都支持来电显示.对于那些这样做的人来说,不同制造商的实施方式各不相同.
Not all modems support caller ID. And for those that do, the implementation varies between manufacturers.
来电显示通过串行数据传递,因此您必须使用 TAPI 库(或 Windows 的超级终端来测试它).来电显示号码通常出现在第一次和第二次响铃之间.
There caller ID is passed through the serial data so you will have to use the TAPI library (or Windows' HyperTerminal to test it). The caller ID number typically appears between the first and the second ring.
您需要向调制解调器发出命令以激活来电显示.通常:
You will need to issue a command to the modem to activate caller ID. Typically:
AT#CID=1
(或AT+VCID=1
)
好的
检查您的调制解调器的文档.
Check the documentation for your modem.
当有来电时,调制解调器会收到一个呼叫字符串.通常:
When a call comes in, the modem will receive the a call string. Typically:
戒指
然后来电显示文本会进来.如果我没记错的话,它的形式是:
Then the caller ID text will come in. If I am remembering correctly, it will be in the form:
NMBR=XXXXXXXXXX
[我正在寻找参考资料.当我找到它时,我会发布一个链接]
更新:啊,找到了.查看此页面,了解各种调制解调器的命令和连接字符串:
UPDATE: Ah, found one. Check out this page for the commands and connection strings for for various modems:
如何测试调制解调器以支持来电显示
这篇关于如何在 C# 中获取来电显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 C# 中获取来电显示?


- WebMatrix WebSecurity PasswordSalt 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01