我已经开发了具有Internet连接的Windows应用程序. [英] I have develop a windows application with internet connection..?
本文介绍了我已经开发了具有Internet连接的Windows应用程序.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经开发了一个Windows应用程序,可以从Internet发送/接收数据.
现在完成了,并且也完美地运行了..
但是我的问题是,当我当时尝试发送或接收数据时,我想检查客户端是否已连接到互联网..根据此结果,我想向连接到互联网的客户端显示一条消息,如果他/她未连接到Internet.
I have develop a windows application that will send/receive data from internet.
now its done and also working perfectly..
but my question is that when i trying to send or receive the data at that time i want to check whether the client is connected to internet or not.. as per this result i want to show a message to client that connect to internet if he/she not connected to internet.
推荐答案
如果您通过Google搜索检查Internet连接状态C#",则将获得大量使用不同方法执行此操作的示例.以下是简短列表:
If you google for "check internet connection status C#" you''ll get a whole bunch of examples doing this with different methods. Here''s a short list:
- http://www.dreamincode.net/code/snippet1568.htm [http://www.c-sharpcorner.com/UploadFile/scottlysle/ConnectionState02092007002552AM/ConnectionState.aspx [
- http://www.dreamincode.net/code/snippet1568.htm[^]
- http://www.c-sharpcorner.com/UploadFile/scottlysle/ConnectionState02092007002552AM/ConnectionState.aspx[^]
您可以从上述搜索词中找到更多信息.
最好的问候,
There are more which you find with the above mentioned search terms.
Best regards,
您可以尝试以下操作:
You can try this:
bool networkUp = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();
这篇关于我已经开发了具有Internet连接的Windows应用程序.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文