Thursday, August 25, 2011

Client Object Model In SharePoint 2010



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClientOM = Microsoft.SharePoint.Client;

namespace SharePointList
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void ShowButton_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            ListsListBox.Items.Clear();
            using(ClientOM.ClientContext ctx=new ClientOM.ClientContext(UrlTextBox.Text))
            {
                ClientOM.Web site=ctx.Web;
                ctx.Load(site);
                ctx.Load(site.Lists);
                ctx.ExecuteQuery();
                foreach (ClientOM.List list in site.Lists)
                {
                    ListsListBox.Items.Add(list.Title);
                    this.Cursor = Cursors.Default;
                }
            }
        }
    }
}

6 comments:


  1. Günümüzde en çok tercih edilen aktivitelerden biri boş zamanları oyunlar oynayarak değerlendirmektir. Bu alanda çeşitli platformlar aracılığıyla yeni oyunlara ulaşmak oldukça kolay hale geldi. Eğer siz de en güncel ve çeşitli oyunları keşfetmek istiyorsanız, oyun indir sitesini ziyaret edebilirsiniz. Böylece sevdiğiniz tarzda birçok oyunu tek platformda bulabilir ve hemen oynamaya başlayabilirsiniz.

    ReplyDelete

Featured Post

Connect to SharePoint Online with Connect-PnPOnline

Goal: Starting from a fresh Windows PC, finish by running one PowerShell command that reads the title of a SharePoint site . Who it's f...

Popular posts