码迷,mamicode.com
首页 > Windows程序 > 详细

C# 判断网络文件是否存在

时间:2017-08-08 15:13:14      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:判断   bre   string   cal   false   oca   http   web   jpg   

#region 判断网络文件是否存在
//bool result = false;//下载结果
//string fileUrl = "http://localhost:7070/FileUpload/135112100.jpg";
//WebResponse response = null;
//try
//{
// WebRequest req = WebRequest.Create(fileUrl);

// response = req.GetResponse();

// result = response == null ? false : true;

//}
//catch (Exception ex)
//{
// result = false;
//}
//finally
//{
// if (response != null)
// {
// response.Close();
// }
//}
#endregion

C# 判断网络文件是否存在

标签:判断   bre   string   cal   false   oca   http   web   jpg   

原文地址:http://www.cnblogs.com/niuniu0108/p/7306356.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!