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

2019-04-15 15:07发布

 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) }