Microsoft Activesync가 PC에 설치되어 있는지 감지하는 방법
-
06-07-2019 - |
문제
PC에 Microsoft ActiveSync가 설치된 경우 가장/가장 신뢰할 수있는 방법은 무엇입니까? 내 PC 프로그램은 RAPI를 사용하여 장치에서 파일을 꺼내고 설치되지 않으면 rapi.dll을 찾을 수없는 오류가 있습니다.
해결책
activeSync가 설치되었는지 여부를 감지하기 위해 레지스트리를 읽을 수 있습니다.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services
다른 팁
/// <summary>
/// Checks to see if ActiveSync/Windows Mobile Device Center
/// is installed on the PC.
/// </summary>
/// <param name="syncVersion">The version of the synchronization tool installed.</param>
/// <returns>True: Either ActiveSync or Windows Mobile Device Center is
/// installed. False: version is null
/// </returns>
private static bool isActiveSyncInstalled(out Version syncVersion)
{
using (RegistryKey reg =
Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows CE Services"))
{
if (reg == null)
{
syncVersion = null;
return false;
}
int majorVersion = (int)reg.GetValue("MajorVersion", 0);
int minorVersion = (int)reg.GetValue("MinorVersion", 0);
int buildNumber = (int)reg.GetValue("BuildNumber", 0);
syncVersion = new Version(majorVersion, minorVersion, buildNumber);
}
return true;
}
당신은 또한 확인할 수도 있습니다
C : Windows System32 rapi.dll 존재합니다
응용 프로그램에 rapi.dll 파일을 포함 시키려고 했습니까?
제휴하지 않습니다 StackOverflow