C# 在Sharepoint中指定路径上创建新列表

C# 在Sharepoint中指定路径上创建新列表,c#,sharepoint-2007,C#,Sharepoint 2007,我想使用Web服务以编程方式在Sharepoint上创建列表。 我尝试了“Lists.AddList方法”,但它只能在当前站点中创建列表 Lists listService = new Lists(); listService.PreAuthenticate = true; listService.Credentials = new NetworkCredential(username,password,domai

我想使用Web服务以编程方式在Sharepoint上创建列表。 我尝试了“Lists.AddList方法”,但它只能在当前站点中创建列表

        Lists listService            = new Lists();
        listService.PreAuthenticate  = true;
        listService.Credentials      = new NetworkCredential(username,password,domain;
        String url                   = "http://YourServer/SiteName/"; // put your desired path here 
        listService.Url              = url @ + /_vti_bin/lists.asmx";

        XmlNode ndList               = listService.AddList(NewListName, "Description", 100);

是否有其他方法创建列表(使用Web服务:C#)

您可以创建所需位置的SPWeb对象,并在其中动态添加列表。请参见以下内容:
        Lists listService            = new Lists();
        listService.PreAuthenticate  = true;
        listService.Credentials      = new NetworkCredential(username,password,domain;
        String url                   = "http://YourServer/SiteName/"; // put your desired path here 
        listService.Url              = url @ + /_vti_bin/lists.asmx";

        XmlNode ndList               = listService.AddList(NewListName, "Description", 100);

您是否尝试过此MSDN页面

        Lists listService            = new Lists();
        listService.PreAuthenticate  = true;
        listService.Credentials      = new NetworkCredential(username,password,domain;
        String url                   = "http://YourServer/SiteName/"; // put your desired path here 
        listService.Url              = url @ + /_vti_bin/lists.asmx";

        XmlNode ndList               = listService.AddList(NewListName, "Description", 100);

我想你可以在这里找到你需要的东西。

在指定路径上创建列表

        Lists listService            = new Lists();
        listService.PreAuthenticate  = true;
        listService.Credentials      = new NetworkCredential(username,password,domain;
        String url                   = "http://YourServer/SiteName/"; // put your desired path here 
        listService.Url              = url @ + /_vti_bin/lists.asmx";

        XmlNode ndList               = listService.AddList(NewListName, "Description", 100);

thanx Brij。但我正在寻找使用Web服务的解决方案。(不使用Microsoft.Sharepoint.dll)thanx jaloplo。但正如我在上面的帖子中提到的。List.AddList方法在当前站点中添加列表。但在这里,我想在我自己的网站上创建一个列表(从用户那里获取输入)。好吧,虽然问题已经得到了回答,但你们可以从他们的任何网站调用任何sharepoint web服务。例如,您有一个url为的站点,还有一个子站点的url为。若要为此网站调用列表web服务,可以使用:,并创建所需的任何列表。