Friday, April 24, 2009

How to access sharepoint website in windows service

using (SPSite site = new SPSite("http://Server/Site/"))

  try
  { 
    using (SPWeb web = site.OpenWeb())
    {
      //some code
    }
  }catch(Exception ex)
  {
    //do something whit exception
  }
}

No comments:

Post a Comment