国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 车致| 灌阳县| 富民县| 罗定市| 甘孜县| 贵定县| 沅陵县| 子长县| 鄂伦春自治旗| 苏尼特左旗| 冷水江市| 永年县| 逊克县| 定陶县| 泾川县| 延安市| 肇源县| 枣阳市| 达州市| 施甸县| 方正县| 达日县| 阳江市| 明水县| 邵东县| 河间市| 石棉县| 宁陵县| 镇雄县| 阿拉善盟| 莱州市| 波密县| 新和县| 合阳县| 光山县| 射阳县| 高淳县| 确山县| 兴业县| 那曲县| 大同市|