CheckSolutionExits:-
public
static
bool
CheckSolutionExits(string sitecollection, string wspname)
{
#region Solution exits
bool Found
= false;
try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using
(SPSite
site = new SPSite(sitecollection))
{
SPList
solGallery = site.GetCatalog(SPListTemplateType.SolutionCatalog);
foreach
(SPListItem item in solGallery.Items)
{
if
(item.File.Name.Equals(wspname))
{
Found = true;
break;
}
}
}
});
}
catch
(Exception
ex)
{
throw ex;
}
#endregion
return
Found;
}
|
No comments:
Post a Comment