public static bool HasModule()
{
if (HttpContext.Current.Application["HasModule"] != null)
{
return (bool)HttpContext.Current.Application["HasModule"];
}
bool result = false;
string path = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "web.config");
XmlTextReader reader = new XmlTextReader(new StreamReader(path));
try
{
if (reader.ReadToFollowing("httpModules"))
{
if (reader.ReadInnerXml().Contains("type=\"Ext.Net.DirectRequestModule"))
{
result = true;
}
}
}
catch
{
result = false;
}
finally
{
reader.Close();
}
HttpContext.Current.Application["HasModule"] = result;
return result;
}