本文介绍了Lan连接状态类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI全部,



我有基于LAN的应用程序与远程SQL服务器连接,因此我想检查是否有LAN网络可用于执行插件数据更新等事件或者从远程服务器中选择或者在没有LAN连接的情况下发生错误



i尝试使用

HI All,

I have LAN based application connected with remote SQL server, therefore i want to check is LAN network is available to execute event like insert data update or select from remote server or otherwise it will occur error without LAN connectivity

i have try with

System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()

它会很好用,但我的应用程序有很多事件要用远程服务器执行,所以我需要将上面的代码应用到它们的每一个像



it will working great but my application has lot of events to execute with remote server, so i need to apply above code to every single of them like

if(System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() == true)
{

//execute command...................... there are thousand of them....
}

else
{
MessageBox.Show("NO LAN Available");
return;
}







所以我想要小班教学与我目前的表格分开可以做以下事情的课程

01.实时局域网连接检查和弹出按摩盒给用户,如果局域网不可用这个按摩盒不会移除,直到局域网再次生效,程序无法工作,直到局域网回到生活。喜欢使用ShowDialog打开表单(这个);



请帮我这个!



谢谢!



SHOUTING删除 - OriginalGriff [/ edit]




SO I want small class for doing this separately from my current forms and classes that can do following things
01. real time LAN connection check and popup massage box to user, if LAN not Available this massage box not remove until LAN live again and the program not working until LAN back to live. like form open using ShowDialog(this);

Help me on this!

Thanks!

[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案


这篇关于Lan连接状态类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:54