惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
B
Blog
V
V2EX
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 聂微东
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
J
Java Code Geeks
H
Help Net Security
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
D
Docker
L
LangChain Blog
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
WordPress大学
WordPress大学
V
Visual Studio Blog

博客园 - 礼拜一

MAC实用技巧 。 工业设计的10个基本法则 Web可用性设计的247条指导方针 选中文本,变绿~ Examples of location paths using the unabbreviated syntax C# Console:利用mspaint打开图像并保存 。 15戒律 HttpWebRequest默认的只有2个并发连接限制!!!!! 在外企工作,一些英語用法潜规则 vs2008命令窗口使用 Visual Studio 2005 中的命令窗口 Error: No such interface supported 动态加载UserControl~ - 礼拜一 - 博客园 英语常用高频语句 jQuery的一些备忘 - 礼拜一 - 博客园 XSLT模式匹配的语法 XPath表达式(缩写和详写方式) 穷死了,看电子书吧~ C#里边的控件缩写大全(比较规范)
获取远程XML文档
礼拜一 · 2010-03-30 · via 博客园 - 礼拜一

Posted on 2010-03-30 16:51  礼拜一  阅读(583)  评论(0)    收藏  举报

        private XDocument GetXDocument(string url)
        {
            Uri uri 
= new Uri(url);
            System.Net.WebClient wb 
= new System.Net.WebClient();
            wb.Proxy.Credentials 
= System.Net.CredentialCache.DefaultCredentials;
            MemoryStream ms 
= new MemoryStream(wb.DownloadData(uri));
            System.Xml.XmlTextReader rdr 
= new System.Xml.XmlTextReader(ms);
            XDocument doc 
= XDocument.Load(rdr);
            
return doc;
        }