这里的情况: 客户端尝试通过wifi连接到互联网。 客户端连接后,服务器发送一个网站地址给客户端,弹出窗口(服务器发送的网站)将默认浏览器出现在客户端计算机上。
我可以列出所有IP连接到服务器,但我不知道如何将网站推送到客户端
感谢
下面是代码列出所有IP连接到服务器:(进口系统.Net库)
String strHostName = "";
if(args == null || args.Length == 0){
strHostName = Dns.GetHostName();
MessageBox.Show("Local Machine's Host Name: " + strHostName);
}else{
strHostName = args[0];
}
IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
IPAddress[] addr = ipEntry.AddressList;
int i = 0;
while(i< addr.Length){
MessageBox.Show("IP Address "+i+": "+addr[i].ToString());
System.Math.Max(System.Threading.Interlocked.Increment(ref i), i - 1);
}
+2
请发布您迄今为止编写的代码。人们通常不喜欢只为你写代码。事实上,这是一个工作描述,而不是一个问题。 –
2011-01-29 02:25:52
+0
ups..sorry,我忘了放置'?' mark:p –
2011-01-30 03:53:30