public static bool IsXmlUrl(string url)
{
try
{
XElement x = XElement.Load(url);
returntrue;
}
catch
{
return false;
}
}
staticvoid Main(string[] args)
{
Console.WriteLine(IsXml.IsXmlUrl("http://www.cnblogs.com"));
Console.WriteLine(IsXml.IsXmlUrl("http://www.cnblogs.com/rss"));
Console.Read();
}