WebDavSession.Credentials Property

IT Hit WebDAV for .NET

Sets and gets credentials for connection.

[Visual Basic]
NotOverridable Public Property Credentials As ICredentials
[C#]
public System.Net.ICredentials Credentials {get; set;}

Example

 string license = "<?xml version='1.0' encoding='utf...
 WebDavSession session = new WebDavSession(license);
 session.Credentials = new NetworkCredential("User1", "pwd");

 IFolder folder = null;
 try
 {
     folder = session.OpenFolder(new Uri("https://server/Products"));
 }
 catch(UnauthorizedException)
 {
     Console.WriteLine("Incorrect user name or password.");
 }
 catch(NotFoundException)
 {
     Console.WriteLine("Folder not found.");
 }

 if(folder!=null)
 {
     Console.WriteLine(folder.LastModified.ToString());
 }
 

See Also

WebDavSession Class | ITHit.WebDAV.Client Namespace