Independentsoft
Home
Products
Purchase
Support
Downloads
Company
Contact
WebDAV .NET
>
Tutorial
> Get all properties
This example shows you how to use method GetProperties to retrieve all file's/folder's properties.
C# example
using System; using System.Net; using Independentsoft.Webdav; namespace Sample { class Program { static void Main(string[] args) { NetworkCredential credential = new NetworkCredential("username", "password"); WebdavSession session = new WebdavSession(credential); Resource resource = new Resource(session); Property[] properties = resource.GetProperties("http://myserver/dav/file1.dat"); for (int i = 0; i < properties.Length; i++) { Console.WriteLine(properties[i].Name); Console.WriteLine(properties[i].Namespace); Console.WriteLine(properties[i].Value); Console.WriteLine("-------------------------------------------------------------"); } Console.Read(); } } }
VB example
Imports System Imports System.Net Imports Independentsoft.Webdav Namespace Sample Class Module1 Shared Sub Main(ByVal args() As String) Dim credential As NetworkCredential = New NetworkCredential("username", "password") Dim session As WebdavSession = New WebdavSession(credential) Dim resource As Resource = New Resource(session) Dim properties() As Independentsoft.Webdav.Property = resource.GetProperties("http://myserver/dav/file1.dat") Dim i As Integer For i = 0 To properties.Length - 1 Console.WriteLine(properties(i).Name) Console.WriteLine(properties(i).Namespace) Console.WriteLine(properties(i).Value) Console.WriteLine("-------------------------------------------------------------") Next Console.Read() End Sub End Class End Namespace