我的C#控制檯應用程序構建於SharePoint Server 2007上。我的工作是從SharePoint網站中選擇庫中的所有項目。然而,我無法將應用程序與SharePoint網站的SPSite對象連接...如何查找將SharePoint與C#控制檯應用程序連接的URL
我的代碼來連接SharePoint網站:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint;
namespace TryToConnect
{
class Program
{
static void Main(string[] args)
{
string siteurl = "http://sp13vm123/";
//string siteurl = "http://sp13vm123/imgLibrary/Forms/AllItems.aspx";
//string siteurl = "http://sp13vm123/imgLibrary/";
//string siteurl = "http://sp13vm123:8800/";
//string siteurl = "http://sp13vm123/SitePages/Home.aspx";
//string siteurl = "http://sp13vm123/SitePages/";
SPSite oSpSite = new SPSite(siteurl);
Console.WriteLine("connected");//nothing
}
}
}
有無法找到關於網址的錯誤訊息...
那麼,如何找到讓我連接的URL?
SharePoint中央管理的URL?錯誤,未找到
佈局頁面的URL?錯誤,未找到
@rene所以,我可以在客戶端模式下連接的URL是什麼? –
@Rene正如國王所說的「C#控制檯應用程序建立在SharePoint服務器2007上」,你真的認爲他需要使用CSOM –
@king如果你的控制檯應用程序在SharePoint服務器上,那麼你不需要用戶CSOM但如果你是在遠程服務器上,那麼你需要使用csom –