bool result = false; WebClient oWebClient = new WebClient(); HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url); HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); if (httpWebResponse.StatusCode == HttpStatusCode.NotAcceptable) { return false; } try { oWebClient.DownloadFile(url, saveUrl + url.Substring(url.LastIndexOf("/") + 1)); result = true; } catch (Exception ex) { } oWebClient.Dispose(); return result;
多次调用这个方法 第一次成功 第二次就失败了 程序卡在那里 不出错 是什么问题?
添加回答
举报
0/150
提交
取消