Match TFS Changeset 303331

This commit is contained in:
2022-02-01 16:17:10 -07:00
parent b8bc6a8443
commit 9c042d3871
118 changed files with 12361 additions and 13 deletions

View File

@ -0,0 +1,36 @@
using System;
namespace Adaptation.Shared.Metrology
{
internal class OIGaNViewer
{
private static System.Net.WebClient _WebClient;
internal static string WebClientDownloadString(string baseAddress, ConfigDataBase configDataBase, string reportFullPath, bool isErrorFile, string target)
{
string result = string.Empty;
if (System.Diagnostics.Debugger.IsAttached)
result = DateTime.Now.ToString();
else
{
if (string.IsNullOrEmpty(baseAddress) || !baseAddress.Contains(":") || !baseAddress.Contains("."))
throw new Exception("Invalid URL");
try
{
if (_WebClient is null)
_WebClient = new System.Net.WebClient();
string address = string.Concat(baseAddress, "/Home/ExtractMove/?equipment_connection=", configDataBase.GetEquipmentType(), "&is_error_file=", isErrorFile);
_WebClient.OpenRead(address);
result = _WebClient.ResponseHeaders["Date"];
_WebClient.CancelAsync();
}
catch (Exception) { }
}
return result;
}
}
}