이것은 간단해야하지만 명백하게는 아닙니다. Since.Windows 3 정도면 전화 또는 전화 & Modem이라는 제어판이 있습니다. 이 제어판은 모뎀 연결 방법에 대한 정보를 모아 놓은 것입니다. 예를 들어, 나가기 위해 9를 누르거나, 지역 번호가 무엇인지 등을 입력해야합니다. 프로그래밍 방식으로이 정보에 어떻게 액세스합니까? C# .NET 2010을 사용 중입니다..NET에서 Windows 전화 걸기 규칙을 찾는 방법
10
A
답변
8
내가 접근 할 수있는 방법을 찾을 수 없습니다 .Ne.
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"));
}
(가 너무 오래하지 검색 후) t의 TAPI 래퍼 그래서 나는 그것이 레지스트리에 저장 않던 발견하고 여기에 액세스하는 코드 (사용자가 특정 요구에 적응할 수)의
procmon 해고
참고 : .NET 호환가있는 경우
- 나는 공식적인 API를 사용하는 것이 좋습니다.
Process.Start(@"C:\Windows\System32\rundll32.exe",@"C:\Windows\System32\shell32.dll,Control_RunDLL C:\Windows\System32\telephon.cpl");
12
Windows에서 Tapi를 사용해야하거나 레지스트리에서 정보를 가져와야합니다. Microsoft Tapi 3.0에 따르면 관리되는 코드에서 사용하도록 설계되지 않았지만 첫 번째 링크에서는이를 수행 한 것으로 보입니다.
- : 링크 # 2
에서
이 TAPI 기능을 살펴보십시오 :에
일부 기사를 볼 수 있습니다
lineGetTranslateCaps
lineTranslateAddress
lineTranslateDialog
lineSetCurrentLocation
lineGetCountry
tapiGetLocationInfo
에서 정보가있는 레지스트리에 저장됩니다 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Locations
0
:
class Program
{
static void Main(string[] args)
{
string rootLocation = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Locations";
getRegistryValues(rootLocation);
Console.ReadLine();
}
public static void getRegistryValues(string rootLocation)
{
RegistryKey locationsKey =
Registry.LocalMachine.OpenSubKey(rootLocation);
if (locationsKey == null) return;
string[] locations = locationsKey.GetSubKeyNames();
Console.WriteLine(locations.Length.ToString());
foreach (var location in locations)
{
Console.WriteLine(location.ToString());
RegistryKey key = locationsKey.OpenSubKey(location);
if (key == null) continue;
foreach (string keyName in key.GetValueNames())
{
if (keyName.Equals("Prefixes"))
{
string[] Prefixes = ((string[])(key.GetValue(keyName)));
Console.Write("Prefixes ");
foreach (string prefix in Prefixes)
{
Console.Write(prefix);
}
}
else
{
Console.WriteLine(keyName + " {0}", key.GetValue(keyName));
}
}
getRegistryValues([email protected]"\"+location);
}
}
여러분 모두에게 감사드립니다. – Rob