获取URL图片(可检查是否存在)

 try
 {

string strUrl = "Pic Url"

System.Net.HttpWebRequest hwreq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(strUrl);

System.Net.HttpWebResponse hwrep = (System.Net.HttpWebResponse)hwreq.GetResponse();

hwrep.length

return(strUrl )

}

else

{

return(DefaultPicUrl)

}

你可能感兴趣的:(获取URL图片(可检查是否存在))