如何知道程序当前运行在模拟器上还是真实设备上?
有时候我们需要让程序自己知道运行在模拟器上还是真实设备上,可以用下面代码实现:
bool IsInEmulator = Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator;
有时候我们需要让程序自己知道运行在模拟器上还是真实设备上,可以用下面代码实现:
bool IsInEmulator = Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator;