Mar*_*all 12
您将需要在Windows中使用Tapi或从注册表中提取信息.根据Microsoft Tapi 3.0的设计不是为了从托管代码中使用,尽管第一个链接似乎已经完成了.
一些文章要看:
来自Link#2
看看这些TAPI函数:
lineGetTranslateCapslineTranslateAddresslineTranslateDialoglineSetCurrentLocationlineGetCountrytapiGetLocationInfo信息存储在注册表中: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Locations
我找不到通过.Net TAPI包装器访问它的方法(在不太长时间的搜索之后)所以我将procmon找到了存放在注册表中的地方,这里是访问它的代码(你可以适应它符合您的特定需求):
RegistryKey locationsKey =
Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Locations");
if (locationsKey == null) return;
string[] locations = locationsKey.GetSubKeyNames();
foreach (var location in locations)
{
RegistryKey key = locationsKey.OpenSubKey(location);
if (key == null) continue;
Console.WriteLine("AreaCode {0}",key.GetValue("AreaCode"));
Console.WriteLine("Country {0}",(int) key.GetValue("Country"));
Console.WriteLine("OutsideAccess {0}", key.GetValue("OutsideAccess"));
}
Run Code Online (Sandbox Code Playgroud)
注意 :
Process.Start(@"C:\Windows\System32\rundll32.exe",@"C:\Windows\System32\shell32.dll,Control_RunDLL C:\Windows\System32\telephon.cpl");
| 归档时间: |
|
| 查看次数: |
1597 次 |
| 最近记录: |