我在导入 SpList 时遇到问题。我尝试复制粘贴很多共享点导入,但仍未修复。请帮我解决这个错误。谢谢你。
public void CheckVersionEnable(string ListName)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite osite = new SPSite("http://it3127:30091/"))
{
using (SPWeb oweb = osite.OpenWeb("http://it3127:30091/"))
{
SPList docs = oweb.Lists[ListName];
if (docs.EnableVersioning == false)
{
docs.EnableVersioning = true;
docs.MajorVersionLimit = 10;
oweb.AllowUnsafeUpdates = true;
docs.Update();
oweb.AllowUnsafeUpdates = false;
}
}
}
});
}
}