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# 中获取来电显示?


基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01