using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Reflection;
using System.Windows.Forms;
public bool isWebEnable(string strURL)
{
try
{
Uri siteUri = new Uri(strURL);
WebRequest wr = WebRequest.Create(siteUri);
wr.Timeout = 10000;
WebResponse myResponse = wr.GetResponse();
myResponse.Close();
return true;
}
catch (WebException ex)
{
string ERRMSG = ex.Message + "\r\n\r\n URL:" + strURL;
MessageBox.Show(ERRMSG, "WEB接続エラー"
, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return false;
}
catch (Exception ex)
{
throw ex;
}
}
最近のコメント