Stream reader = null; //可能是外部链接 if (imgUrl.ToLower().StartsWith("http://")) { var request = System.Net.WebRequest.Create(imgUrl); var response = request.GetResponse(); reader = response.GetResponseStream(); } else { reader = new FileStream( System.Web.HttpContext.Current.Server.MapPath( imgUrl ), FileMode.Open ); }
时间: 2024-09-29 00:59:45