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