c# - 如何在 C# 中导入原始 RSS 提要?

标签 c# xml wcf rss import

有谁知道将原始 XML RSS 提要导入 C# 的简单方法?我正在寻找一种将 XML 作为字符串获取的简单方法,以便我可以使用正则表达式对其进行解析。

谢谢, -格雷格

最佳答案

这应该足以让你继续......

using System.Net 

WebClient wc = new WebClient();

Stream st = wc.OpenRead(“http://example.com/feed.rss”);

using (StreamReader sr = new StreamReader(st)) {
   string rss = sr.ReadToEnd();
}

关于c# - 如何在 C# 中导入原始 RSS 提要?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67937/

相关文章:

c# - WCF错误: The socket connection was aborted

c# - 如何在 WCF 操作中创建异步/后台进程?

c# - 依赖注入(inject) IDbConnection SqlConnection

c# - 将 session 变量转换为 html

ios - 如何在同一位置读取和写入 xml 文件?

xml - Applescript - 解析 XML

.net - 以编程方式将 SSL 证书绑定(bind)到端口

c# - 从 Azure Blob 存储下载文件

c# - 包装和重新抛出异常会影响性能吗?

javascript - 模拟 :starts-with or :ends-with for searching text? 的 jQuery 选择器