![]() ![]() Using the above, you can tell if the Cisco VPN client is connected. If (primaryService) service = primaryService) /* When the Cisco VPN is active, I get "" here */ NSString *netIPv4Key = [NSString *netIPv4Dictionary = (NSMutableDictionary *) SCDynamicStoreCopyValue(dynamicStoreDomainState, (CFStringRef)netIPv4Key) SCDynamicStoreRef dynamicStoreDomainState = SCDynamicStoreCreate(NULL, The programmatic equivalent of the scutil command that he gave is something like #import ![]() Yet another way is to use process.start to run a CLI (command line) of "vpnclient stat", redirect standard output to a stringbuilder in your app and then check the string whether it contains appropriate data - for more info on this see here:Īs "diciu" wrote, you can query the System Configuration framework. If (MojPopisDostupnih.IndexOf("Cisco Systems VPN Adapter") != -1) (mo.ToString()) įor (int j = 0 j <= MojPopisDostupnih.Length - 1 j ) ![]() Try įoreach (ManagementObject mo in quer圜ollection) HKEY_LOCAL_MACHINE\SOFTWARE\Cisco Systems\VPN Client\AllAccess\TunnelEstablished (0 or 1)Īnother way is to do it is to detect it by the name of the network interface it establishes via using ManagementObjectSearcher, sample code below: ManagementObjectSearcher query = null One of the easiest ways is to check a registry setting found at: ![]() There are several ways, actually, without using the API (which I still cant find/DL) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |