开发学院软件开发Python python操作sharepoint对象模型 阅读

python操作sharepoint对象模型

 2010-09-22 11:27:22 来源:WEB开发网 闂傚倸鍊风欢姘缚瑜嶈灋闁圭虎鍠栫粻顖炴煥閻曞倹瀚�闂傚倸鍊风粈渚€骞夐敓鐘插瀭闁汇垹鐏氬畷鏌ユ煙閹殿喖顣奸柛搴$У閵囧嫰骞掗幋婵冨亾閻㈢ǹ纾婚柟鐐灱濡插牊绻涢崱妤冃℃繛宀婁簽缁辨捇宕掑鎵佹瀸闂佺懓鍤栭幏锟�濠电姷鏁告慨顓㈠箯閸愵喖宸濇い鎾寸箘閹规洟姊绘笟鈧ḿ褍煤閵堝悿娲Ω閳轰胶鍔﹀銈嗗笂閼冲爼鍩婇弴銏$厪闁搞儮鏅涙禒褏绱掓潏鈺佷槐闁轰焦鎹囬弫鎾绘晸閿燂拷闂傚倸鍊风欢姘缚瑜嶈灋闁圭虎鍠栫粻顖炴煥閻曞倹瀚�  闂傚倸鍊烽懗鑸电仚缂備胶绮〃鍛村煝瀹ュ鍗抽柕蹇曞У閻庮剟姊虹紒妯哄闁诲繑姘ㄩ埀顒佸嚬閸撶喎顫忓ú顏勫瀭妞ゆ洖鎳庨崜浼存⒑闁偛鑻晶顔剧磼婢跺﹦绉虹€殿喖顭锋俊姝岊槷闁稿鎹囧Λ鍐ㄢ槈濞嗗繑娈橀梻浣风串缂嶁偓濞存粠鍓熼崺鈧い鎺戝€归弳顒勬煕鐎n亷韬€规洑鍗冲鍊燁槾闁哄棴绠撻弻銊╂偆閸屾稑顏�
核心提示: PyWebusing System;using System.Collections.Generic;using System.Text;using Microsoft.SharePoint;using System.Runtime.InteropServices;namespace Py

PyWeb

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.Runtime.InteropServices;

namespace PySP
{
    [ComVisible(true)]
    public class PyWeb
    {
        protected SPWeb web = null;

        protected void EnsureWeb()
        {
            if (this.web == null)
                throw new NullReferenceException("the web object can't be null!");
        }

        public PyWeb() { }

        public PyWeb(SPSite site, string url)
        {
            this.web = site.OpenWeb(url);
        }

      
        public bool AllowAnonymousAccess
        {
            get
            {
                EnsureWeb();
                return this.web.AllowAnonymousAccess;
            }

        }

       

        public bool AllowRssFeeds
        {
            get
            {
                EnsureWeb();
                return this.web.AllowRssFeeds;
            }

        }

        public bool AllowUnsafeUpdates
        {
            get
            {
                EnsureWeb();
                return this.web.AllowUnsafeUpdates;
            }
            set
            {
                EnsureWeb();
                this.web.AllowUnsafeUpdates = value;
            }
        }


        public string Title
        {
            get
            {
                EnsureWeb();
                return this.web.Title;
            }
            set
            {
                EnsureWeb();
                this.web.Title = value;
            }
        }

        public string Description
        {
            get
            {
                EnsureWeb();
                return this.web.Description;
            }
            set
            {
                EnsureWeb();
                this.web.Description = value;
            }
        }

        public string Name
        {
            get
            {
                EnsureWeb();
                return this.web.Name; 
            }
            set
            {
                EnsureWeb();
                this.web.Name = value;
            }
        }
        

        public uint Language
        {
            get
            {
                EnsureWeb();
                return this.web.Language; 
            }
        }

        public void Update()
        {
            EnsureWeb();
            this.web.Update();
        }

        public void Delete()
        {
            EnsureWeb();
            this.web.Delete(); 
        }

        public void Close()
        {
            if (this.web != null)
            {
                this.web.Dispose();
                this.web = null;
            }
        }

        public PyListCollection Lists
        {
            get
            {
                EnsureWeb();
                return new PyListCollection(this.web.Lists);
            }
        }

    }
}

上一页  1 2 3 4 5 6 7  下一页

Tags:python 操作 sharepoint

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接