c# - Win Mobile 6.5.3 模拟器无法连接到互联网

标签 c# mobile-emulator

环境:Windows Mobile 6.5.3 Professional VGA Emulator

在“工具”->“设备仿真器管理器”中,我连接到仿真器并放置了设备(左侧的图标从绿色箭头变为网络连接)。

我正在尝试通过代理访问 Web 服务。在Windows 7 Professional桌面Windows Application环境下,可以访问Web服务;在模拟器中(我在设备上测试之前的步骤 - MC75A)我得到以下信息:

_HResult        -2146233079                                     int
_innerException null                                            System.Exception
_message        "Could not establish connection to network."    string
_methodDescs    {System.IntPtr[19]}                             System.IntPtr[]
HResult         -2146233079                                     int
InnerException  Could not evaluate expression                   System.Exception
Message         "Could not establish connection to network."    string
StackTrace
   at System.Net.HttpWebRequest.finishGetResponse()
   at System.Net.HttpWebRequest.GetResponse()
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at MobilePOS.WebReference.Service.FetchNewSession(String OperatorCode, String Password)
   at MobilePOS.TelechargeProxy.FetchNewSession()
   at MobilePOS.Username_Password.fetch_new_session(String user_name, String password)
   at MobilePOS.Username_Password.user_valid(String user_ID, String password)
   at MobilePOS.Login.quick_login_BUT_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
   at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
   at System.Windows.Forms.Form.ShowDialog()
   at MobilePOS.Mobile_POS.Mobile_POS_Dispatcher()
   at MobilePOS.Program.Main()

m_Response      null                                            System.Net.WebResponse
m_Status        ConnectFailure                                  System.Net.WebExceptionStatus
Response        Could not evaluate expression                   System.Net.WebResponse
Status          ConnectFailure                                  System.Net.WebExceptionStatus

在同事的建议下,我尝试访问 www.google.com。结果是

Cannot connect with current connection 
settings. To change your connection settings,
tap Settings.

当我点击设置时,我得到

My ISP
Add a new modem connection
My Work Network
Add a new modem connection
Add a new VPN server connection
Set up my proxy server

我尝试了 File->Configure->Network 并检查了 Enable NE2000.... 重置(软)后没有任何改变。

此时我迷路了。

如有任何帮助,我们将不胜感激。

TIA

古斯

最佳答案

经过大量无用的研究,我们决定付钱给微软来回答这个问题。

微软声明

问题

当您在桌面上运行 Windows Mobile 6.5 模拟器时,模拟器发送的 TCP/IP 数据包不会通过 VPN 软件路由到您的公司网络。

解决方案

模拟器使用的网络接口(interface)插入 TCP/IP 堆栈的位置低于 VPN 应用程序看到的位置,因此它们被路由到 Internet。通过使用桌面直通(DMA 模式下的 WMDC 和设备管理器中的仿真器),VPN 应用程序确实看到了数据包并根据需要将它们路由到公司网络。


要遵循的过程包括以下步骤:

  1. 在 Windows 机器上启动 VPN Client(安装 设备模拟器执行)。
  2. 启动 Visual Studio 并打开使用 VPN 的解决方案。
  3. 目标设备(在工具栏或项目属性中)设置为 所需的模拟器。
  4. 点击工具->连接到设备...
  5. 在“连接到设备”对话框中,突出显示所需的模拟器 设备列表框并点击连接
  6. 等待连接成功,然后点击关闭
  7. 点击工具->设备模拟器管理器...
  8. 最大化 Device Emulator Manager。
  9. 在数据存储树中找到您希望使用的模拟器。
  10. 如果名称前面没有绿色箭头图标, 右键单击其名称,然后单击右侧按钮中的连接 上下文菜单。
  11. 当模拟器名称以绿色箭头图标为前缀时,对 单击名称并从右侧按钮上下文中选择 Cradle 菜单。
  12. 最小化 Device Emulator Manager 窗口。
  13. Windows Mobile 设备中心窗口将打开。 (关闭任何 可能出现的 Windows Mobile 成员(member)中心窗口。)
  14. 在“移动设备中心”窗口中,“已连接”复选标记应 出现在设备图像下方的左侧。
  15. 点击连接而不设置您的设备
  16. 将鼠标悬停在移动设备设置上。
  17. 点击连接设置链接。
  18. “连接设置”对话框打开。确保所有四个 复选框被选中;第一个下拉菜单选择了 DMA; 并且第二个下拉菜单选择了互联网。 (如果有 在托管机器上执行的代理,选择工作网络 第二个下拉菜单。)
  19. 单击确定关闭“连接设置”对话框。
  20. 最小化 Windows Mobile 设备中心窗口。

以通常的方式调试应用程序。希望这可以帮助。

古斯

关于c# - Win Mobile 6.5.3 模拟器无法连接到互联网,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9619628/

相关文章:

java - Selenium - 移动仿真 - 如何在自动化仿真器时将用户代理添加到 Chrome 选项?

android - 在网站上嵌入移动模拟器?

c# - 准备一个实时应用程序来保存不可预见事件的状态数据,例如意外关闭、崩溃等

c# - 在 C# 中使用 `using` 关键字避免多次处置的最佳实践

c# - 使用 Windows 调试器调试 C# 源代码

C#:Oracle 数据类型与 OracleDbType 等价

c# - 来自 .Net 的异步电子邮件

visual-studio - 模拟器在 Windows 10 上的奇怪行为