argotic

Check if a URL is a valid Feed

谁说胖子不能爱 提交于 2020-01-11 02:39:45
问题 I'm using Argotic Syndication Framework for processing feeds. But the problem is, if I pass a URL to Argotic, which is not a valid feed (for example, http://stackoverflow.com which is a html page, not feed), the program hangs (I mean, Argotic stays in an infinity loop) So, How to check if a URL is pointing to a valid feed? 回答1: From .NET 3.5 you can do this below. It will throw an exception if it's not a valid feed. using System.Diagnostics; using System.ServiceModel.Syndication; using System