国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

展現(xiàn)C# 清單5.10 生成exe文件執(zhí)行的問題

2024-07-21 02:16:04
字體:
供稿:網(wǎng)友

清單  5.10  通過一個(gè)索引獲取一個(gè)ip地址

1: using system;
2: using system.net;
3:
4: class resolvedns
5: {
6:  ipaddress[] m_arrips;
7:
8:  public void resolve(string strhost)
9:  {
10:  iphostentry iphe = dns.gethostbyname(strhost);
11:  m_arrips = iphe.addresslist;
12:  }
13:
14:  public ipaddress this[int nindex]
15:  {
16:  get
17:  {
18:    return m_arrips[nindex];
19:  }
20:  }
21:
22:  public int count
23:  {
24:  get { return m_arrips.length; }
25:  }
26: }
27:
28: class dnsresolverapp
29: {
30:  public static void main()
31:  {
32:  resolvedns mydnsresolver = new resolvedns();
33:  mydnsresolver.resolve("http://www.microsoft.com");
34:
35:  int ncount = mydnsresolver.count;
36:  console.writeline("found {0} ip's for hostname", ncount);
37:  for (int i=0; i < ncount; i++)
38:    console.writeline(mydnsresolver[i]);
39:  } 
40: }

編譯環(huán)境:

 visual studio .net2003 version 7.1.3091  microsoft visual c# .net  

 microsoft .net framework version 1.1.4322 sp1

生成的exe文件,執(zhí)行后報(bào)錯(cuò):

未處理的“system.net.sockets.socketexception”類型的異常出現(xiàn)在 system.dll 中。

其他信息: the requested name is valid and was found in the database, but it does not have the correct associated data being resolved for

這是為什么呢?……
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿尔山市| 抚宁县| 信宜市| 清涧县| 九龙县| 临朐县| 万山特区| 武冈市| 古蔺县| 河东区| 乐都县| 水富县| 上高县| 永济市| 墨江| 达州市| 巴马| 广安市| 丘北县| 昌宁县| 中西区| 朝阳县| 静安区| 红安县| 若羌县| 东城区| 赤城县| 塔城市| 牟定县| 乐安县| 彭水| 海晏县| 泰来县| 太仆寺旗| 秦皇岛市| 迭部县| 赞皇县| 锡林浩特市| 鄂托克旗| 吉首市| 灵宝市|