/Platform/Windows/Commands/NetSH/URLACL.cs |
@@ -4,6 +4,7 @@ |
// rights of fair usage, the disclaimer and warranty conditions. // |
/////////////////////////////////////////////////////////////////////////// |
|
using System; |
using System.ComponentModel; |
using System.Diagnostics; |
using System.Text; |
@@ -11,21 +12,20 @@ |
|
namespace wasSharpNET.Platform.Windows.Commands.NetSH |
{ |
public class URLACL |
public class URLACL : IDisposable |
{ |
private readonly string domain; |
private readonly int timeout; |
private readonly string URL; |
private string domain { get; set; } |
private int timeout { get; set; } = 60000; |
private string URL { get; set; } |
|
private readonly Regex URLReservationRegex; |
private readonly string username; |
private Regex URLReservationRegex { get; set; } |
private string username { get; set; } |
|
public URLACL(string URL, string username, string domain, int timeout) |
public URLACL(string URL, string username, string domain) |
{ |
this.URL = URL; |
this.username = username; |
this.domain = domain; |
this.timeout = timeout; |
|
URLReservationRegex = |
new Regex( |
@@ -32,9 +32,14 @@ |
$@"{Regex.Escape(URL)}.*{Regex.Escape($@"{domain}\{username}")}", |
RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | |
RegexOptions.Compiled); |
} |
|
public URLACL(string URL, string username, string domain, int timeout) : this(URL, username, domain) |
{ |
this.timeout = timeout; |
} |
|
public bool isReserved |
public bool IsReserved |
{ |
get |
{ |
@@ -58,7 +63,7 @@ |
|
checkProcess.Start(); |
checkProcess.BeginOutputReadLine(); |
checkProcess.WaitForExit(60000); |
checkProcess.WaitForExit(timeout); |
|
return URLReservationRegex.IsMatch(netSHOutput.ToString()); |
} |
@@ -117,5 +122,9 @@ |
|
return process.WaitForExit(timeout); |
} |
|
public void Dispose() |
{ |
} |
} |
} |