Match TFS Changeset 303331
This commit is contained in:
36
Adaptation/Shared/Metrology/OIGaNViewer.cs
Normal file
36
Adaptation/Shared/Metrology/OIGaNViewer.cs
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user