WebDav explorer [Beta]
This commit is contained in:
parent
6c6b4b29a5
commit
3396e34c8e
27 changed files with 2119 additions and 1713 deletions
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
|
@ -159,6 +160,8 @@ namespace WebsitePanel.WebDav.Core
|
|||
request.Method = "PROPFIND";
|
||||
request.ContentType = "application/xml";
|
||||
request.Headers["Depth"] = "1";
|
||||
//TODO Disable SSL
|
||||
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
|
||||
|
||||
var credentials = (NetworkCredential) _credentials;
|
||||
if (credentials != null && credentials.UserName != null)
|
||||
|
|
|
@ -73,11 +73,13 @@ namespace WebsitePanel.WebDav.Core
|
|||
public Uri Href
|
||||
{
|
||||
get { return _href; }
|
||||
set { SetHref(value.ToString(), new Uri(value.Scheme + "://" + value.Host + value.Segments[0] + value.Segments[1])); }
|
||||
}
|
||||
|
||||
public ItemType ItemType
|
||||
{
|
||||
get { return _itemType; }
|
||||
set { SetItemType(value); }
|
||||
}
|
||||
|
||||
public DateTime LastModified
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
@ -122,6 +123,8 @@ namespace WebsitePanel.WebDav.Core
|
|||
var webClient = new WebClient();
|
||||
webClient.Credentials = credentials;
|
||||
webClient.Headers.Add("Authorization", auth);
|
||||
//TODO Disable SSL
|
||||
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate{ return true; });
|
||||
return webClient.OpenRead(_href);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
{
|
||||
public class WebDavSession
|
||||
{
|
||||
public ICredentials Credentials { get; set; }
|
||||
public NetworkCredential Credentials { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns IFolder corresponding to path.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue