/// Check to see if the site exists
///
/// If the site exists in the farm
private static bool CheckSiteExists(string siteName, string webName)
{
//open site and web
using (SPSite site = new SPSite(siteName))
{
using (SPWeb web = site.OpenWeb(webName))
{
//if the web does not exist return false
if (!web.Exists)
{
return false;
}
else //otherwise
return it does
{
return true;
}
}
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment