| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 869 人关注过本帖
标题:ToString报错,谁能帮我看一下报错的原因?
取消只看楼主 加入收藏
athenalux
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:河北石家庄
等 级:小飞侠
威 望:8
帖 子:975
专家分:2514
注 册:2008-11-26
结帖率:100%
收藏
 问题点数:0 回复次数:0 
ToString报错,谁能帮我看一下报错的原因?
using System;
using
class app
{
public static void Main()
{
string hoststring ="000";
Console.WriteLine("please enter hostname:");
hoststring = Console.ReadLine();
IPHostEntry hostinfo = Dns.GetHostEntry(hoststring);
 IPAddress[] ips = hostinfo.AddressList;
string[] alias = hostinfo.Aliases;
Console.WriteLine("Host name : " + hostinfo.HostName);
Console.WriteLine("\nAliases : ");
for (int index = 0; index < alias.Length; index++)
 {
Console.WriteLine(alias[index]);
}
 Console.WriteLine("\nIP Address list :");
  for (int index = 0; index < ips.Length; index++)
 {
Console.WriteLine(ips[index].ToString);
}
}
}

红色部份编译不能通过,但看MSDN里面说ipaddress类有tostring的方法,为什么会出错呢?
搜索更多相关主题的帖子: ToString 
2008-12-04 09:20
快速回复:ToString报错,谁能帮我看一下报错的原因?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016655 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved