This commit is contained in:
roman
2025-10-05 21:51:24 +02:00
parent dc8b3bc01f
commit 030664b2ef
630 changed files with 197935 additions and 2473 deletions

40
Mip/AppOptions.cs Normal file
View File

@@ -0,0 +1,40 @@
using System;
using System.Net.NetworkInformation;
namespace Mip
{
public class AppOptions
{
public string Host { get; set; }
public string Port { get; set; }
public string LoginName { get; set; }
public string Password { get; set; }
public string Database { get; set; }
public bool Connetable { get; set; }
public AppOptions(string host, string port, string loginName, string password, string database)
{
Host = host;
Port = port;
LoginName = loginName;
Password = password;
Database = database;
Connetable = CheckConnectivity();
}
private bool CheckConnectivity()
{
Ping pingIP = new Ping();
try
{
var pingReply = pingIP.Send(Host);
return pingReply.Status.ToString() == "Success";
}
catch (Exception)
{
return false;
}
}
}
}