using System.Net;
try
{string path=" http://202.106.139.25/TDP/ShowPicture?imgUrl=/ttlprog/app/wl81/openhotel/HOTO/output/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"/WJ/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"WJ01.jpg";
WebRequest webRequest = WebRequest.Create(@path);// 建立web请求
webRequest.Timeout = 2 * 1000;
WebResponse webResponse = webRequest.GetResponse(); // 获得web服务器的回应
//有效执行下面这行
ds.Tables[3].Rows[i]["img"]=" http://202.106.139.25/TDP/ShowPicture?imgUrl=/ttlprog/app/wl81/openhotel/HOTO/output/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"/WJ/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"WJ01.jpg";
}
catch//否则执行下面
{ds.Tables[3].Rows[i]["img"]="images/nopic.jpg";}
try
{string path=" http://202.106.139.25/TDP/ShowPicture?imgUrl=/ttlprog/app/wl81/openhotel/HOTO/output/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"/WJ/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"WJ01.jpg";
WebRequest webRequest = WebRequest.Create(@path);// 建立web请求
webRequest.Timeout = 2 * 1000;
WebResponse webResponse = webRequest.GetResponse(); // 获得web服务器的回应
//有效执行下面这行
ds.Tables[3].Rows[i]["img"]=" http://202.106.139.25/TDP/ShowPicture?imgUrl=/ttlprog/app/wl81/openhotel/HOTO/output/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"/WJ/"+ds.Tables[3].Rows[i]["PropertyID"].ToString().Substring(2,3)+"WJ01.jpg";
}
catch//否则执行下面
{ds.Tables[3].Rows[i]["img"]="images/nopic.jpg";}