Created
December 15, 2015 07:21
-
-
Save 5l/aaff0ad62297b9c3e740 to your computer and use it in GitHub Desktop.
CGSS_isEmulator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool isEmulator() | |
{ | |
Process[] processes = Process.GetProcesses(); | |
if (processes != null && processes.Length != 0) | |
{ | |
Process[] array = processes; | |
for (int i = 0; i < array.Length; i++) | |
{ | |
Process process = array[i]; | |
try | |
{ | |
if (process.get_ProcessName().Contains("com.bluestacks")) | |
{ | |
bool result = true; | |
return result; | |
} | |
if (process.get_ProcessName().Contains("com.genymotion")) | |
{ | |
bool result = true; | |
return result; | |
} | |
if (process.get_ProcessName().Contains("com.windroy")) | |
{ | |
bool result = true; | |
return result; | |
} | |
} | |
catch (InvalidOperationException) | |
{ | |
} | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment