private bool FileExists(string fileUrl) { bool result = false;//下载结果 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(); } } return result; }