博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

随笔分类 -  Sharepoint 2007

摘要:在Sharepoint开发中可能需要一次删除成百上千条记录,这时候如果轮询SPList.Items并直接调用该对象的删除方法来删除的话性能极差,会叫你崩溃。 下面介绍一个快速删除大量数据的方法: using (SPWeb myweb = mysite.AllWebs[“XXXX”]) { SPLis 阅读全文

posted @ 2015-11-03 22:21 木头人Ricky 阅读(951) 评论(0) 推荐(0)

摘要:我们使用.NET类库中的API发Mail的时候,我们要配置他的SMTP Server等,但是在Sharepoint里,已经提供了相关的封装的方法: SPUtility.SendEmail(SPWeb, false, false,"to@mail.com", "MailTitle","MailBody 阅读全文

posted @ 2015-11-03 22:14 木头人Ricky 阅读(309) 评论(0) 推荐(0)

该文被密码保护。

posted @ 2015-10-30 13:45 木头人Ricky 阅读(226) 评论(0) 推荐(0)

摘要:After ASP.NET 3.5 has been installed you need to modify the web.config file of your MOSS web site with a few Ajax specific entries. Typically, the web... 阅读全文

posted @ 2014-05-15 11:23 木头人Ricky 阅读(241) 评论(0) 推荐(0)

摘要:/// /// 从PeopleEditor取值 /// /// /// public static List GetSPPrincipalsFromPeopleEditor(PeopleEditor peopleEditor) { List rtn = new Lis... 阅读全文

posted @ 2014-01-17 12:35 木头人Ricky 阅读(492) 评论(0) 推荐(0)

摘要:代码片段如下:方法一(文档库):stringstrProgId="SharePoint.OpenDocuments";stringicon=SPUtility.MapToIcon(listItem.Web,listItem.File.Name,strProgId,IconSize.Size16);stringiconUrl=string.Format("{0}/_layouts/images/{1}",listItem.Web.ServerRelativeUrl,icon);方法二(列表附件):stringstrs="";SPAtta 阅读全文

posted @ 2012-11-14 11:40 木头人Ricky 阅读(208) 评论(0) 推荐(0)

摘要:方法一:网站操作--->编辑页面。方法二:在URL中加入 ControlMode=Edit&DisplayMode=Design,实际上只需要DisplayMode=Design就可以了。方法三:在URL中加入 ToolpaneView=2 阅读全文

posted @ 2012-08-29 14:53 木头人Ricky 阅读(262) 评论(0) 推荐(0)

摘要:By using “Content Editor Web part” we can display PDF File in SharePoint site.1.Add a “Content Editor Web part” to your SharePoint page.2.Click on the “Open the Tool Pane”, click on “Source Editor” to place the HTML source.3.Place the following piece of code in to the Source Editor and click ok<e 阅读全文

posted @ 2011-05-09 17:02 木头人Ricky 阅读(207) 评论(0) 推荐(0)

摘要:using(SPWebospWeb=SPContext.Current.Web){//...Logic}Pageerror “Trying to use an SPWeb object that has been closed or disposed and is no longer valid.”Modified the code as shown below:using(SPSite spSite=new SPSite(SPContext.Current.Web.Url)){using (SPWeb spWeb = spSite.OpenWeb()){//...Logic}}MSDN cl 阅读全文

posted @ 2011-04-29 15:06 木头人Ricky 阅读(303) 评论(0) 推荐(0)

摘要:SPRoleAssignmentCollectionras=list.RoleAssignments;foreach(SPRoleAssignmentrainras){.....SPRoleAssignmentnewRoleAssignment=newSPRoleAssignment((SPPrincipal)list.ParentWeb.EnsureUser("domain\user"));SPRoleDefinitionnewRoleDefinition=list.ParentWeb.RoleDefinitions["参与"];newRoleAssi 阅读全文

posted @ 2011-04-02 17:33 木头人Ricky 阅读(740) 评论(0) 推荐(0)

摘要:新建一个GUID实例 自定义格式字符串“b”传递给该实例的 ToString 方法, 则 Convert.ToString 的重载返回该实例的值的二进制(基 2)字符串表示形式Guid.NewGuid().ToString("n") ="4546a166b64746f784099789ec8f8324" Guid.NewGuid().ToString("b")="{4546a166-b647-46f7-8409-9789ec8f8324}" Guid.NewGuid().ToString("d" 阅读全文

posted @ 2010-11-18 13:52 木头人Ricky 阅读(2137) 评论(0) 推荐(0)

摘要:问题:AD + SQL2005 + Sharepoint2007 三台独立服务器,在配置Sharepoint2007时,使用IP地址连接数据库。由于公司的网络调整,需要变更所有服器的IP网段,发现Sharepoint服务器无法连接数据库报“无法连接到配置服务器”。解决方案:在Sharepoint服务器上双击c:\windows\system32\cliconfg.exe 启... 阅读全文

posted @ 2010-08-21 16:26 木头人Ricky 阅读(1022) 评论(0) 推荐(0)