2011-02-02 28 views

回答

3

试试这个代码:

public void InstallFeature(string name, bool force) 
{ 
    string relativePath = name + @"\feature.xml"; 
    Microsoft.SharePoint.Administration.SPFarm.Local.FeatureDefinitions.Add(relativePath, Guid.Empty, force); 
}