winform 下载 asp.net里的文件报错,求助啊
写了个更新的程序,路径是完全正确的,开始用
//提供url路径,并下载到本地 WebRequest request = WebRequest.Create("http://222.35.76.37/Download/XMLFile.xml"); request.Method = "get"; WebResponse response = request.GetResponse(); Stream s = response.GetResponseStream(); StreamReader readerNew = new StreamReader(s, Encoding.Default); string xml = readerNew.ReadToEnd(); response.Close(); File.WriteAllText(Application.StartupPath + @"\XMLFile.xml", xml); //保存到本地