我在仿真器或设备上运行 [英] Am I running on an Emulator or a Device

查看:81
本文介绍了我在仿真器或设备上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法(希望使用托管代码)来确定我是在仿真器上运行还是在实际的物理设备上运行?

Is there a way (using managed code hopefully) to find out if I am running on an Emulator or an actual physical device?

我正在寻找类似的东西此:

I am looking for something like this:

public class BarcodeScannerFactory
{
  public override BarcodeScanner GetBarcodeScanner() 
  {
    if (IsARealDevice())    <---------------------------+
       return new SymbolBarcodeScanner();               |
    else                                                |
       return new FakeBarcodeScanner();                 |
  }                                                     |
}                                                       |
                                                        |
// This is the method I need to make    ----------------+

(注意:在我看来,Windows Phone 7已与下面的大多数标签结合在一起。但是,这个问题是针对Window Mobile 6.5的。)

(NOTE: It occurs to me that Windows Phone 7 has been lumped in with most of the tags below. This question however, is intended for Window Mobile 6.5.)

推荐答案

某些事情沿着这几行您的意思是?

这篇关于我在仿真器或设备上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆