SPList list = web.GetListFromUrl(u);
SPFolder folder = web.GetFolder(string.Format("0}/{1}",list.RootFolder.Url,foldername));
if (!folder.Exists)
{
folder = list.RootFolder.SubFolders.Add(foldername);
}
using (MemoryStream stream = new MemoryStream())
{
nds.WriteXml(stream);
SPFile file = folder.Files.Add(filename, stream);
}
No comments:
Post a Comment