All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET中基类页的设计和使用_.net资料_编程技术
数据库死锁导致网站站点访问不了之解决方案_[SQL,Server教程]
[delphi语法6]delphi中Repeat语句的使用实例
八 图像 Images_[Html教程]
Asp.Net,Ajax,学习笔记3,UpdatePanel的使用(上)_[Asp.Net教程]
ASP.NET实现匿名访问控制_[Asp.Net教程]
初学认识:javascript和Java是两个完全不同的语言_JavaScript技术_编程技术
mscorwks.dll在.Net中的地位以及在.Net代码保护方面的应用_[Asp.Net教程]
中英文对照学习认识一下XML语言_[XML教程]
C#教程:C#中的变量
Reading number is top 10 pictures
On the verge of extinction of the beach1
Chinese paper-cut grilles art appreciation2
青春清纯美女大集合1
A letter to parents choose world of warcraft seven big reason
乳娘帕梅拉安德森3
A beautiful girl to bud3
采访谢楠
Sell the barbecue as says father du breul1
支持判处贩卖儿童者死刑
29 the belle stars after bath figure3
Download software ranking
Ashlynn Video2
功夫熊猫2(上集)
都市狐狸姑娘传
传奇私服架设教程
Boxer's Top ten classic battle2
Twenty piece of palm leaf
C语言教程TXT
apache-tomcat-6.0.33
天龙八部十二宫服务端
双旗镇刀客A
delv published in(发表于) 2014/1/6 9:06:10 Edit(编辑)
C#中如何得到主机名与IP地址_[Asp.Net教程]

C#中如何得到主机名与IP地址_[Asp.Net教程]

C#中如何得到主机名与IP地址_[Asp.Net教程]

/*


* Copyright (c) 2006,四川师范大学


* All rights reserved.


* 文件名称:GetIpAndName


* 文件标识:见配置管理计划书


* 文件摘要:得到本地主机的名字与IP


*/


using System;


using System.Net;


/*


* 当前版本:1.0


* 软件作者:安美洪


* 完成日期:2006年3月28日


*


* 取代版本:无


* 原作者 :无


* 完成日期:无


*/


namespace GetIpAndName


{


class Class1


{


[STAThread]


static void Main(string[] args)


{


//得到主机名


string name = Dns.GetHostName();


Console.WriteLine("主机名字:{0}",name);


IPHostEntry me = Dns.GetHostByName(name);


//输出得到的IP


foreach (IPAddress ip in me.AddressList)


{


Console.WriteLine("IP 地址:{0}",ip.ToString());


}


Console.Read();


}


}


}







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.