共用方式為


Lists.GetListCollection method

傳回在網站中的所有清單的名稱和 Guid。

Namespace:  WebSvcLists
Assembly:  STSSOAP (in STSSOAP.dll)

Syntax

'宣告
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetListCollection", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetListCollection As XmlNode
'用途
Dim instance As Lists
Dim returnValue As XmlNode

returnValue = instance.GetListCollection()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetListCollection", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetListCollection()

傳回值

Type: System.Xml.XmlNode
下列格式的清單,且包含其名稱和 Guid 片段中共同作業應用程式標記語言 (CAML)可以指派給System.Xml.XmlNode物件。

<Lists xmlns="https://schemas.microsoft.com/sharepoint/soap/">
   <List DocTemplateUrl=
      "" DefaultViewUrl="/TestWeb1/Lists/Announcements/AllItems.aspx" 
      ID="{8A98E2E5-B377-4D0E-931B-3AC25BD09926}" Title="Announcements" 
      Description="Use the Announcements list to post messages on the 
         home page of your site." 
      ImageUrl="/_layouts/images/itann.gif" 
         Name="{8A98E2E5-B377-4D0E-931B-3AC25BD09926}" 
      BaseType="0" ServerTemplate="104" 
         Created="20030613 18:47:12" Modified="20030613 18:47:12" 
      LastDeleted="20030613 18:47:12" Version="0" Direction="none" 
         ThumbnailSize="" WebImageWidth="" 
      WebImageHeight="" Flags="4096" ItemCount="1" 
         AnonymousPermMask="" RootFolder="" ReadSecurity="1" 
      WriteSecurity="1" Author="1" 
         EventSinkAssembly="" EventSinkClass="" 
         EventSinkData="" EmailInsertsFolder="" 
      AllowDeletion="True" AllowMultiResponses="False" 
         EnableAttachments="True" EnableModeration="False" 
      EnableVersioning="False" Hidden="False" MultipleDataList="False" 
         Ordered="False" ShowUser="True" />
   <List DocTemplateUrl=
      "" DefaultViewUrl="/TestWeb1/Lists/Contacts/AllItems.aspx" 
      ID="{9FFE6155-DB75-4E0C-B18C-095326112151}" Title="Contacts" 
      Description="Use the Contacts list for information about people 
         that your team works with." 
      ImageUrl="/_layouts/images/itcontct.gif" 
         Name="{9FFE6155-DB75-4E0C-B18C-095326112151}" 
      BaseType="0" ServerTemplate="105" Created="20030613 18:47:14" 
         Modified="20030613 18:47:14" 
      LastDeleted="20030613 18:47:14" Version="0" Direction="none" 
         ThumbnailSize="" WebImageWidth="" 
      WebImageHeight="" Flags="4096" ItemCount="0" 
         AnonymousPermMask="" RootFolder="" ReadSecurity="1" 
      WriteSecurity="1" Author="1" 
         EventSinkAssembly="" EventSinkClass="" EventSinkData="" 
      EmailInsertsFolder="" AllowDeletion="True" 
         AllowMultiResponses="False" EnableAttachments="True" 
      EnableModeration="False" EnableVersioning="False" Hidden="False" 
         MultipleDataList="False" 
      Ordered="False" ShowUser="True" />
      ...
</Lists>

Examples

下列程式碼範例會在目前的網站上顯示每個清單的相關資訊。

本範例會要求using (Visual C#) 或System.Xml命名空間所包含的Imports (Visual Basic 中) 指示詞。

Dim listService As New Web_Reference_Folder.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim ndLists As XmlNode = listService.GetListCollection()

MessageBox.Show(ndLists.OuterXml)
Web_Reference_Folder.Lists listService = new Web_Reference_Folder.Lists();
listService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlNode ndLists = listService.GetListCollection();

MessageBox.Show(ndLists.OuterXml);

請參閱

參照

Lists class

Lists members

WebSvcLists namespace