如何获取Windows Mobile模拟器的IP地址 [英] How to get IP address of Windows mobile emulator

查看:201
本文介绍了如何获取Windows Mobile模拟器的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

有没有人告诉我如何获取Windows Mobile模拟器的IP地址(通过ActiveSyn 4.5与PC连接).

感谢您的回答.

问候,
大松

PS.我的母语不是英语.所以我可能会犯一些错误...对此感到抱歉.

解决方案

using System;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace SmartDeviceProject1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main()
        {
        
            try
            {
                IPHostEntry IPHost = Dns.Resolve(Dns.GetHostName());
                IPAddress[] addressList = IPHost.AddressList;
                if (addressList.Length > 0)
                {
                    StringBuilder address = new StringBuilder();
                    foreach (IPAddress a in addressList)
                    {
                        address.Append(a.ToString());
                        address.Append(" ");
                    }
                    MessageBox.Show(address.ToString(), "IP Addresses");
                }
                else
                    MessageBox.Show("Unable to determine network address", "Error");
            }
            catch (Exception)
            {
                MessageBox.Show("Unable to determine network address", "Error");
            }
        
           
        }
    }
}


Dear All,

Are there anybody show me how to get IP address of windows mobile emulator (connect with PC via ActiveSyn 4.5).

Thanks for any answer.

Regards,
DaiSon

PS. My mother language is not english.So I can make some mistakes... Im sorry for that

解决方案

using System;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace SmartDeviceProject1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main()
        {
        
            try
            {
                IPHostEntry IPHost = Dns.Resolve(Dns.GetHostName());
                IPAddress[] addressList = IPHost.AddressList;
                if (addressList.Length > 0)
                {
                    StringBuilder address = new StringBuilder();
                    foreach (IPAddress a in addressList)
                    {
                        address.Append(a.ToString());
                        address.Append(" ");
                    }
                    MessageBox.Show(address.ToString(), "IP Addresses");
                }
                else
                    MessageBox.Show("Unable to determine network address", "Error");
            }
            catch (Exception)
            {
                MessageBox.Show("Unable to determine network address", "Error");
            }
        
           
        }
    }
}


这篇关于如何获取Windows Mobile模拟器的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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