分享一些ShrePoint的代码(二)
摘要:上传文件到SharePoint 1 if (File1.PostedFile == null) 2 return; 3 4 string destUrl = TextBox1.Text; 5 6 SPWeb site = new SPSite(destUrl).OpenWeb(); 7 8 Stream fStream = File1.PostedFile.InputStream; 9 byte[] contents = new byte[fStream.Length];10 11 fStream.Read(contents, 0, (int)fStream.Length);12...
阅读全文
posted @
2012-07-27 14:11
wengnet
阅读(736)
推荐(0)
分享一些ShrePoint的代码(一)
摘要:遍历所有网站和列表 1 SPSite oSiteCollection = SPContext.Current.Site; 2 SPWebCollection collWebsite = oSiteCollection.AllWebs; 3 4 for (int i = 0; i < collWebsite.Count; i++) 5 { 6 using (SPWeb oWebsite = collWebsite[i]) 7 { 8 SPListCollection collList = oWebsite.Lists; 9 10 for (int...
阅读全文
posted @
2012-07-26 15:35
wengnet
阅读(674)
推荐(1)
动态创建CustomAction
摘要:直接上Code:XML1 <CustomAction2 GroupId="PersonalActions"3 Id="bac2275f-3512-4ca0-b0c1-6e47907b2bd0"4 Location="Microsoft.SharePoint.StandardMenu"5 ControlAssembly="你的程序集"6 ControlClass="动态创建菜单的类名字"7 >8 </C...
阅读全文
posted @
2012-07-13 15:10
wengnet
阅读(449)
推荐(0)