Uri urlCheck = new Uri("http://tw.yahoo.com");
System.Net.WebRequest request = System.Net.WebRequest.Create(urlCheck);
System.Net.WebResponse response;
try
{
response = request.GetResponse();
Response.Write("OK");
}
catch (Exception)
{
Response.Write("Error");
}
全站熱搜