下面这段代码
using (WebResponse response = request.GetResponse()){ using (StreamReader rd = new StreamReader(response.GetResponseStream())) { XDocument xd = XDocument.Load(rd.ReadToEnd()); }}
在VS2005 会报 :路径中有非法字符 错误
如果改成
using (WebResponse response = request.GetResponse()){ using (StreamReader rd = new StreamReader(response.GetResponseStream())) { XDocument xd = XDocument.Load(new System.IO.StringReader(rd.ReadToEnd())); }}
就可以通过 。