2012. 1. 7. 21:01
출처 : http://blog.naver.com/PostView.nhn?blogId=inidu2&logNo=110032861546&categoryNo=0&parentCategoryNo=33&viewDate=¤tPage=4&postListTopCurrentPage=1&userTopListOpen=true&userTopListCount=10&userTopListManageOpen=false&userTopListCurrentPage=4
인터넷이 연결이 되었는지를 체크하기위한 코드..
마이크로 소프트의 SmartClient Application Building Block 중에서 온라인 체크및 각종 기능이 있다는데..
간단히 코드로 확인하는방법이 ..
출처 : http://www.c-sharpcorner.com/Code/2003/Aug/CheckInternetConnection.asp
using System ;
using System.Runtime ;
using System.Runtime.InteropServices ;
public class InternetCS
{
//Creating the extern function...
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( out int Description, intReservedValue ) ;//Creating a function that uses the API function...
public static bool IsConnectedToInternet( )
{int Desc ;
return InternetGetConnectedState( out Desc, 0 ) ;}
}
인터넷이 끊어지는 상황이 발생 중간중간 연결 여부를 체크할 필요가 있어졌다.
연결이 되어 있을때만 실행. 'PP > TIP' 카테고리의 다른 글
ASP.NET에서 오류 보고 페이지를 만드는 방법 (0) | 2012.01.08 |
---|---|
제네릭 처리기를 이용하여 자동가입방지 폼 구현 (0) | 2012.01.07 |
자동 업데이트 (0) | 2012.01.07 |
HttpContext, HttpWebRequest, HttpWebResponse, Application 등의 경로 (0) | 2012.01.07 |
this.Invoke 관련 (0) | 2012.01.06 |