HttpWebRequest request = WebRequest.Create("https://www.google.com/accounts/o8/id") as HttpWebRequest;
request .Accept = "application/xrds+xml";
HttpWebResponse response = (HttpWebResponse)request .GetResponse();
返回xrds文档。 如何阅读该文件。
答案 0 :(得分:2)
取决于你想要做什么 - 如果你只需要阅读回来的内容,那么你可以将文档加载到XmlDocument中并以编程方式检查它,例如。
XmlDocument rdsDocument;
HttpWebRequest request = WebRequest.Create("https://www.google.com/accounts/o8/id") as HttpWebRequest;
request.Accept = "application/xrds+xml";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
rdsDocument = new XmlDocument();
rdsDocument.Load(response.GetResponseStream());
答案 1 :(得分:0)