并不是所有时候都适合用using(){},只有当需要提升用户的权限的时候才会用到using,其他时候都可以直接使用SPContext.Current.Web;
            using (SPSite site = new SPSite(SPContext.Current.Web.Url))
            {
                using (SPWeb web = site.OpenWeb())
                {
    }

什么时候用using (SPSite site = new SPSite(SPContext.Current.Web.Url))的更多相关文章

  1. Linq to SharePoint与权限提升(转)

    转自http://www.cnblogs.com/kaneboy/archive/2012/01/25/2437086.html SharePoint 2010支持Linq to SharePoint ...

  2. Sharepoint学习笔记—习题系列--70-573习题解析 -(Q97-Q99)

    04 }Which code segment should you add at line 03?A. currentItem["ClassificationMetadata"] ...

  3. SharePoint 2013 如何使用TaxonomyWebTaggingControl 控件

    在该文章中,我将介绍如何使用TaxonomyWebTaggingControl控件, 首先我相信您已经在SharePoint Managed Metadata Service里定义Term Sets, ...

  4. SharePoint WebPart 简单的读取列表内容的web部件

    最近,自己也在学习写一些SharePoint的部件,也就是使用对象模型,下面,介绍一下自己刚刚写的小测试程序,不足之处,还请指正. 1.  新建项目 Vs2008 – 新建 – 项目 – 类库 – 输 ...

  5. {sharepoint}提升 SharePoint 代码执行权限

    提升 SharePoint 代码执行权限 关于如何提升 SharePoint 代码执行权限及相关知识介绍的文章我们园子里有很多, 这里给出其中两篇文章的链接,就不再啰嗦了. http://www.cn ...

  6. Build Tree View Structure for SharePoint List Data

    博客地址 http://blog.csdn.net/foxdave 此文参考自->原文链接 版权归原作者所有,我只是进行一下大致的翻译 应坛友要求,帮助验证一下功能. SharePoint列表数 ...

  7. SharePoint2013代码操作权限组的几个Demo

    1,清明节闲来无聊,敲代码吧,不知道敲什么,不敲吧,又好像比较颓废,不思进取.遂把以前项目中别的同事负责的权限模块的代码看一看,做俩个Demo. (1)代码创建组 protected void Cre ...

  8. Sharepoint 根据文件相对路径获取、操作SPFolder

    public AjaxResult LoadDocInfo(HttpContext httpContext) { var result = new ArrayList(); try { var org ...

  9. sharepoint 2010项目中,ashx页面获取SPContext.Current 为null的原因和解决方法

    //错误的写法 public void ProcessRequest(HttpContext context) { SPSecurity.RunWithElevatedPrivileges(deleg ...

随机推荐

  1. Learning WCF Chapter2 Service Contracts

    A service contract describes the operations supported by a service,the message exchange pattern they ...

  2. LA_3263_That_Nice_Euler_Circuits_(欧拉定理+计算几何基础)

    描述 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=15& ...

  3. Linux Kernel 'sctp_v6_xmit()'函数信息泄露漏洞(CVE-2013-4350)

    漏洞版本: Linux kernel 漏洞描述: BUGTRAQ ID: 62405 CVE(CAN) ID: CVE-2013-4350 Linux Kernel是Linux操作系统的内核. Lin ...

  4. 【转】 Android——eclipse共享library以及导出jar包

    原文网址:http://blog.csdn.net/jscese/article/details/36627195 android的apk在在eclipse上进行开发的时候,有时候需要import其它 ...

  5. EF-查看生成的SQL语句

    老版本中:EF 4和EF 3.5 SP1 using (var context = new TestDBEntities()) { var query = from p in context.Pare ...

  6. Android TextView : “Do not concatenate text displayed with setText”

    参考:http://stackoverflow.com/questions/33164886/android-textview-do-not-concatenate-text-displayed-wi ...

  7. atomic_t原子操作

    所谓原子操作,就是该操作绝不会在执行完毕前被任何其他任务或事件打断,也就说,它的最小的执行单位,不可能有比它更小的执行单位,因此这里的原子实际是使用了物理学里的物质微粒的概念. 原子操作需要硬件的支持 ...

  8. 使用alloctor模板来实现string类

    虽然以前做过更复杂的各种数据结构,不过那只是在看完c++prime7章后做的,没有考虑到类的拷贝体现出来是类值还是类指针,于是写了一些半成品类,不过那些主要是练数据结构,不想再改,于是就想办法模仿了下 ...

  9. 【转】git - 简明指南

    git - 简明指南 助你入门 git 的简明指南,木有高深内容 ;) 作者:罗杰·杜德勒 感谢:@tfnico, @fhd 和 Namics其他语言 english, deutsch, españo ...

  10. MySQL添加外键时报错 ERROR 1215 (HY000): Cannot add foreign key constraint

    1.数据类型      2.数据表的引擎 数据表 mysql> show tables; +------------------+ | Tables_in_market | +--------- ...