Dim listService As New WssListsSvc.Lists()
Dim m_credentials As ICredentials = New Net.NetworkCredential(UserId, Pwd, Domain)
listService.Credentials = m_credentials
Dim result As XmlNode = listService.GetList(sLibName)
For Each ndField As XmlNode In result.FirstChild.ChildNodes
Dim IsReadOnly As String = String.Empty
End If
If Not IsReadOnly = "TRUE" Then
If ndField.Attributes("DisplayName") IsNot Nothing Then
name = DirectCast(ndField.Attributes("DisplayName").Value, String)
End If If sTagType.ToLower = "custom" Then
Dim SourceID = DirectCast(ndField.Attributes("SourceID").Value, String)
If SourceID.Contains("sharepoint") = False Then
Else sReturnValue = name & "," & sReturnValue End If
C# Version
string sReturnValue = null; string sReturnValuec = null; WssListsSvc.Lists listService = new WssListsSvc.Lists(); ICredentials m_credentials = new System.Net.NetworkCredential(UserId, Pwd, Domain); listService.Credentials = m_credentials; XmlNode result = listService.GetList(sLibName); foreach (XmlNode ndField in result.FirstChild.ChildNodes) { string IsReadOnly = string.Empty; string name = string.Empty; if (ndField.Attributes("ReadOnly") != null) { IsReadOnly = (string)ndField.Attributes("ReadOnly").Value; } if (!(IsReadOnly == "TRUE")) { if (ndField.Attributes("DisplayName") != null) { name = (string)ndField.Attributes("DisplayName").Value; } if (sTagType.ToLower == "custom") { dynamic SourceID = (string)ndField.Attributes("SourceID").Value; if (SourceID.Contains("sharepoint") == false) { sReturnValue = name + "," + sReturnValue; } } else { sReturnValue = name + "," + sReturnValue; } } }
2.: sTagType Contains the values “All” or “Custom”. If all is passed then all the
columns are retrieved and if custom is selected then Custom Columns Comma separated
list is returned.