C#获得远程IP的方法? 如果是内部IP,即保留的ip以192,10等开头,是不能通过internet用其ip地址访问的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的意思是想获得他局域网内的IP吧 这个只能用activex控件让客户下载...如果它不下,好象很难:( IPHostEntry hostInfo = Dns.GetHostByName("www.microsoft.com"); IPAddress[] address = hostInfo.AddressList; String[] alias = hostInfo.Aliases; Response.Write("Host name : " + hostInfo.HostName + "<br>"); Response.Write("\nAliases : " + "<br>"); for(int index=0; index < alias.Length; index++) { Response.Write(alias[index] + "<br>"); } Response.Write("\nIP address list : " + "<br>"); for(int index=0; index < address.Length; index++) { Response.Write(address[index] + "<br>"); } 楼主试试下面using System.IO;using System.Net;using System.Text;using System.Diagnostics;namespace ZZConsoleTest{ public class ZZConsole { [STAThread] static void Main(string[] args) { //String hostName = Dns.GetHostName(); IPHostEntry hostInfo = Dns.GetHostByName("www.163.com"); IPAddress[] address = 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 < address.Length; index++) { Console.WriteLine(address[index]); } Console.WriteLine("完成"); Console.ReadLine(); } }} 关于类访问权限问题,一个比较隐蔽的类,只对我指定的类公开呢?这个应该如何做 Xenocode 怎么混淆整个项目 C#如何传递函数 正则表达式,控制输入汉字的问题 c#如何实现提交一份数据,保存到多个空间里。 更改winform窗体状态栏的图标 文本数据保护问题 asp中在弹出一个对话框后怎么样取得对话框的值?急~~~在线等!!请高手帮忙~~ (WinForm)怎么得到DATAGRID的数据并保存 请列出学习C#的较好的中文书籍(象深入浅出MFC一样的) 请问各位朋友:如何将遍历一棵树按照某一个条件进行修改结点? 如何编程获取rar文件中的内容
这个只能用activex控件
让客户下载...如果它不下,好象很难:(
IPAddress[] address = hostInfo.AddressList;
String[] alias = hostInfo.Aliases; Response.Write("Host name : " + hostInfo.HostName + "<br>");
Response.Write("\nAliases : " + "<br>");
for(int index=0; index < alias.Length; index++)
{
Response.Write(alias[index] + "<br>");
}
Response.Write("\nIP address list : " + "<br>");
for(int index=0; index < address.Length; index++)
{
Response.Write(address[index] + "<br>");
}
using System.IO;
using System.Net;
using System.Text;
using System.Diagnostics;namespace ZZConsoleTest
{
public class ZZConsole
{
[STAThread]
static void Main(string[] args)
{
//String hostName = Dns.GetHostName(); IPHostEntry hostInfo = Dns.GetHostByName("www.163.com");
IPAddress[] address = 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 < address.Length; index++)
{
Console.WriteLine(address[index]);
}
Console.WriteLine("完成");
Console.ReadLine();
}
}
}