From ed55e77e983d714e23416e908902fc5b625bcd02 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 17 Mar 2026 17:25:08 +0300 Subject: [PATCH] add projects --- .gitattributes | 63 ++ .gitignore | 6 +- AddHostToProxy/AddHostToProxy.csproj | 20 + AddHostToProxy/ListDev.csv | 11 + AddHostToProxy/Program.cs | 123 +++ CheckEVS/CheckEVS.csproj | 15 + CheckEVS/Disks.cs | 104 ++ CheckEVS/Program.cs | 437 +++++++++ CheckEVS/test.json | 913 ++++++++++++++++++ CheckTimeHikvision/App.config | 6 + CheckTimeHikvision/CheckTimeHikvision.csproj | 96 ++ CheckTimeHikvision/Program.cs | 105 ++ CheckTimeHikvision/Properties/AssemblyInfo.cs | 33 + ChekTimeDahua/ChekTimeDahua.csproj | 11 + ChekTimeDahua/Program.cs | 90 ++ DahuaIPCRename/DahuaIPCRename.csproj | 10 + DahuaIPCRename/Program.cs | 48 + LICENSE | 4 +- README.md | 3 +- SwitchDahua/Form1.Designer.cs | 229 +++++ SwitchDahua/Form1.cs | 212 ++++ SwitchDahua/Form1.resx | 120 +++ SwitchDahua/LLDP.cs | 65 ++ SwitchDahua/Program.cs | 17 + SwitchDahua/SwitchDahua.csproj | 15 + Wiking/Controllers/TestController.cs | 71 ++ .../Controllers/WeatherForecastController.cs | 62 ++ Wiking/Program.cs | 36 + Wiking/Properties/launchSettings.json | 41 + Wiking/WeatherForecast.cs | 13 + Wiking/Wiking.csproj | 19 + Wiking/Wiking.http | 6 + Wiking/appsettings.Development.json | 8 + Wiking/appsettings.json | 9 + Wiking/htmlpage.html | 475 +++++++++ lsConsole/Program.cs | 122 +++ lsConsole/listCam.csv | 790 +++++++++++++++ lsConsole/lsConsole.csproj | 20 + lsSoft.slnx | 10 + 39 files changed, 4430 insertions(+), 8 deletions(-) create mode 100644 .gitattributes create mode 100644 AddHostToProxy/AddHostToProxy.csproj create mode 100644 AddHostToProxy/ListDev.csv create mode 100644 AddHostToProxy/Program.cs create mode 100644 CheckEVS/CheckEVS.csproj create mode 100644 CheckEVS/Disks.cs create mode 100644 CheckEVS/Program.cs create mode 100644 CheckEVS/test.json create mode 100644 CheckTimeHikvision/App.config create mode 100644 CheckTimeHikvision/CheckTimeHikvision.csproj create mode 100644 CheckTimeHikvision/Program.cs create mode 100644 CheckTimeHikvision/Properties/AssemblyInfo.cs create mode 100644 ChekTimeDahua/ChekTimeDahua.csproj create mode 100644 ChekTimeDahua/Program.cs create mode 100644 DahuaIPCRename/DahuaIPCRename.csproj create mode 100644 DahuaIPCRename/Program.cs create mode 100644 SwitchDahua/Form1.Designer.cs create mode 100644 SwitchDahua/Form1.cs create mode 100644 SwitchDahua/Form1.resx create mode 100644 SwitchDahua/LLDP.cs create mode 100644 SwitchDahua/Program.cs create mode 100644 SwitchDahua/SwitchDahua.csproj create mode 100644 Wiking/Controllers/TestController.cs create mode 100644 Wiking/Controllers/WeatherForecastController.cs create mode 100644 Wiking/Program.cs create mode 100644 Wiking/Properties/launchSettings.json create mode 100644 Wiking/WeatherForecast.cs create mode 100644 Wiking/Wiking.csproj create mode 100644 Wiking/Wiking.http create mode 100644 Wiking/appsettings.Development.json create mode 100644 Wiking/appsettings.json create mode 100644 Wiking/htmlpage.html create mode 100644 lsConsole/Program.cs create mode 100644 lsConsole/listCam.csv create mode 100644 lsConsole/lsConsole.csproj create mode 100644 lsSoft.slnx diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index e9957b0..4bd60b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.rsuser @@ -30,6 +30,7 @@ x86/ bld/ [Bb]in/ [Oo]bj/ +[Oo]ut/ [Ll]og/ [Ll]ogs/ @@ -414,6 +415,3 @@ FodyWeavers.xsd # Built Visual Studio Code Extensions *.vsix -# ---> Ansible -*.retry - diff --git a/AddHostToProxy/AddHostToProxy.csproj b/AddHostToProxy/AddHostToProxy.csproj new file mode 100644 index 0000000..b07b03b --- /dev/null +++ b/AddHostToProxy/AddHostToProxy.csproj @@ -0,0 +1,20 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + Always + + + + diff --git a/AddHostToProxy/ListDev.csv b/AddHostToProxy/ListDev.csv new file mode 100644 index 0000000..d6a2bbf --- /dev/null +++ b/AddHostToProxy/ListDev.csv @@ -0,0 +1,11 @@ +172.16.48.140;storage01 +172.16.48.141;storage02 +172.16.48.142;storage03 +172.16.48.143;storage04 +172.16.48.144;storage05 +172.16.48.145;storage06 +172.16.48.146;storage07 +172.16.48.147;storage08 +172.16.48.148;storage09 +172.16.48.149;storage10 +172.16.48.150;storage11 \ No newline at end of file diff --git a/AddHostToProxy/Program.cs b/AddHostToProxy/Program.cs new file mode 100644 index 0000000..e38ea0d --- /dev/null +++ b/AddHostToProxy/Program.cs @@ -0,0 +1,123 @@ +using System.Net; +using System.Net.Http; +using System.Net.Http.Json; +using System.Text; +using System.Text.Json; + +namespace AddHostToProxy +{ + internal class Program + { + public static List> ListDev = new List>(); + static async Task Main(string[] args) + { + ListDev = ReadCsvFile("ListDev.csv"); + string str = await GetTokenAsync(); + foreach (var item in ListDev) + { + var host = new HostProxy(); + var lsDomain = new List(); + var _meta = new Meta(); + host.meta = _meta; + lsDomain.Add(item.Value+".vnk.security.local"); + host.domain_names = lsDomain; + host.forward_host = item.Key; + var str2 = await AddProxyHostAsync(str, host); + Console.WriteLine($"{item.Key}\t{str2}"); + } + Console.WriteLine("========== ЗАКОНЧИЛ ============"); + Console.ReadKey(); + } + + public static async Task GetTokenAsync() + { + using var client = new HttpClient(); + + var payload = new { identity = "admin@security.local", secret = "4NUDZhJ7" }; + var response = await client.PostAsJsonAsync("http://172.16.48.129:81/api/tokens", payload); + + if (response.IsSuccessStatusCode) + { + // Десериализуем ответ напрямую в динамический объект или анонимный тип + var data = await response.Content.ReadFromJsonAsync(); + return data?.Token.ToString(); + } + + return "null"; + } + + public static async Task AddProxyHostAsync(string token, object data) + { + using var _httpClient = new HttpClient(); + // Формируем данные запроса + var jsonContent = JsonSerializer.Serialize(data); + var httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json"); + + // Устанавливаем заголовки + _httpClient.DefaultRequestHeaders.Clear(); + _httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}"); + + // Отправляем запрос + var httpResponse = await _httpClient.PostAsync("http://172.16.48.129:81/api/nginx/proxy-hosts", httpContent); + //var httpResponse = await _httpClient.PutAsync($"http://172.16.48.129:81/api/nginx/proxy-hosts", httpContent); + + // Проверяем статус ответа + httpResponse.EnsureSuccessStatusCode(); + + // Возвращаем статус-код + return httpResponse.StatusCode.ToString(); + } + + public static List> ReadCsvFile(string filePath) + { + using (var reader = new StreamReader(filePath)) + { + while (!reader.EndOfStream) + { + var line = reader.ReadLine(); + if (string.IsNullOrEmpty(line)) continue; + + // Разбиваем строку по запятой (предполагая CSV с разделителем запятой) + var parts = line.Split(';'); + + // Проверяем, что строка содержит хотя бы две части + if (parts.Length >= 2) + { + // Приводим результаты к строкам и добавляем в список + ListDev.Add(new KeyValuePair(parts[0].Trim(), parts[1].Trim())); + } + } + } + + return ListDev; + } + + // Класс для десериализации ответа + public record TokenResponse(string Token, DateTime Expires); + + } + public class Meta + { + public bool nginx_online { get; set; } = true; + public object nginx_err { get; set; } = null; + } + public class HostProxy + { + public bool enabled { get; set; } = true; + public List domain_names { get; set; } + public string forward_scheme { get; set; } = "https"; + public string forward_host { get; set; } + public int forward_port { get; set; } = 443; + public int access_list_id { get; set; } = 0; + public int certificate_id { get; set; } = 1; + public bool ssl_forced { get; set; } = false; + public bool caching_enabled { get; set; } = false; + public bool block_exploits { get; set; } = false; + public string advanced_config { get; set; } = ""; + public Meta meta { get; set; } + public bool allow_websocket_upgrade { get; set; } = true; + public bool http2_support { get; set; } = false; + public bool hsts_enabled { get; set; } = false; + public bool hsts_subdomains { get; set; } = false; + } +} diff --git a/CheckEVS/CheckEVS.csproj b/CheckEVS/CheckEVS.csproj new file mode 100644 index 0000000..eda5e5d --- /dev/null +++ b/CheckEVS/CheckEVS.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + 0.1 + + + + + + + diff --git a/CheckEVS/Disks.cs b/CheckEVS/Disks.cs new file mode 100644 index 0000000..02b4ff9 --- /dev/null +++ b/CheckEVS/Disks.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CheckEVS +{ + public class Disks + { + public int id { get; set; } + public Params @params { get; set; } + public bool result { get; set; } + public string session { get; set; } + } + + public class Device + { + public string BUS { get; set; } + public double Capacity { get; set; } + public int CmrSize { get; set; } + public string DRTypeMixState { get; set; } + public string Firmware { get; set; } + public int LogicNo { get; set; } + public int MRType { get; set; } + public string Media { get; set; } + public string MediaType { get; set; } + public string Module { get; set; } + public string Name { get; set; } + public int OpState { get; set; } + public string Parent { get; set; } + public List Partitions { get; set; } + public int PhysicNo { get; set; } + public int PosLedState { get; set; } + public string PowerMode { get; set; } + public string PreDiskCheck { get; set; } + public string SerialNo { get; set; } + public string State { get; set; } + public Tank Tank { get; set; } + public int UseMode { get; set; } + public string Volume { get; set; } + public int? Temperature { get; set; } + public Raid Raid { get; set; } + } + + public class MemberInfo + { + public int ID { get; set; } + public bool Spare { get; set; } + } + + public class Params + { + public List tank { get; set; } + } + + public class Partition + { + public string FileSystem { get; set; } + public bool IsSupportFs { get; set; } + public string Name { get; set; } + public int Start { get; set; } + public object Total { get; set; } + } + + public class Raid + { + public int ActiveDevices { get; set; } + public string AliasName { get; set; } + public int ChunkSize { get; set; } + public int FailedDevices { get; set; } + public int Level { get; set; } + public List MemberInfos { get; set; } + public List Members { get; set; } + public int RaidDevices { get; set; } + public double RecoverMBps { get; set; } + public double RecoverPercent { get; set; } + public int RecoverTimeRemain { get; set; } + public int SpareDevices { get; set; } + public List State { get; set; } + public int Sync { get; set; } + public int TotalDevices { get; set; } + public string UUID { get; set; } + public int WorkingDevices { get; set; } + } + + public class Tank + { + public List Device { get; set; } + public double FreeSpace { get; set; } + public int Level { get; set; } + public int SlotNum { get; set; } + public int TankNo { get; set; } + public double Temperature { get; set; } + public double TotalSpace { get; set; } + } + + public class Tank2 + { + public int Level { get; set; } + public int Slot { get; set; } + public int TankNo { get; set; } + } +} diff --git a/CheckEVS/Program.cs b/CheckEVS/Program.cs new file mode 100644 index 0000000..19e6cd0 --- /dev/null +++ b/CheckEVS/Program.cs @@ -0,0 +1,437 @@ +using CheckEVS; +using System; +using System.Net.Http; +using System.Net.Http.Json; +using System.Security.Cryptography; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace DahuaDiskChecker +{ + class Program + { + static async Task Main(string[] args) + { + string server = string.Empty; + + //Console.WriteLine("=== ПРОВЕРКА СОСТОЯНИЯ ДИСКА DAHUA ==="); +#if DEBUG + Console.WriteLine("Введи ip-адрес EVS:"); + server = Console.ReadLine(); + Console.WriteLine("Введи номер диска: (0 - количество неисправных, 1-24 - статус указанного"); + int diskNumber = Convert.ToInt32(Console.ReadLine()); +#else + + // Парсинг аргументов + if (args.Length < 2) + { + await PromoPrint(); + + //Console.WriteLine("Использование: DahuaDiskChecker.exe <номер_диска> [пользователь] [пароль]"); + //Console.WriteLine("Пример: DahuaDiskChecker.exe 172.16.48.147 10 admin admin"); + return; + } + server = args[0]; + if (!int.TryParse(args[1], out int diskNumber)) + { + //Console.WriteLine("❌ Ошибка: номер диска должен быть числом"); + return; + } +#endif + string user = args.Length > 2 ? args[2] : "admin"; + string password = args.Length > 3 ? args[3] : "4NUDZhJ7"; + + try + { + var checker = new DahuaDiskChecker(); + string status = await checker.CheckDiskStatusAsync(server, diskNumber, user, password); + + // Вывод результата + //Console.WriteLine(); + //Console.WriteLine(new string('=', 40)); + + try + { + Convert.ToInt32(status); + Console.WriteLine(status); + } + catch (Exception) + { + if (status == "NotFound") + { + Console.WriteLine("10"); + } + else if (status == "Good") + { + Console.WriteLine("0"); + } + else + { + Console.WriteLine("1"); + } + } +#if DEBUG + Console.ReadKey(); +#endif + + //Console.WriteLine(new string('=', 40)); + } + catch (Exception ex) + { + Console.WriteLine($"❌ Ошибка: {ex.Message}"); + } + } + + private static async Task PromoPrint() + { + // ╔ ═ ╦ ╗ ║ ╟ ╤ │ ─ ┷ ╢ ╚ ╝ + Console.WriteLine("╔════════════════════════════╤════════════╗"); + Console.WriteLine("║ autor: mastankov │ ver: 0.1 ║"); + Console.WriteLine("╟────────────────────────────┴────────────╢"); + Console.WriteLine("║ Пример: ║"); + Console.WriteLine("║ DahuaDiskChecker.exe <номер_диска> ║"); + Console.WriteLine("║ Вернет статус запрошенного диска ║"); + Console.WriteLine("║ ║"); + Console.WriteLine("║ DahuaDiskChecker.exe 0 ║"); + Console.WriteLine("║ Вернет количество неисправных дисков ║"); + Console.WriteLine("║ ║"); + Console.WriteLine("║ Нажми Enter, чтобы выйти ║"); + Console.WriteLine("╚═════════════════════════════════════════╝"); + //Console.ReadKey(); + } + } + + public class DahuaDiskChecker + { + private readonly HttpClient _httpClient; + + public DahuaDiskChecker() + { + _httpClient = new HttpClient(); + _httpClient.Timeout = TimeSpan.FromSeconds(30); + } + + // Вычисление MD5 хэша + private string CalculateMD5(string input) + { + using (MD5 md5 = MD5.Create()) + { + byte[] inputBytes = Encoding.UTF8.GetBytes(input); + byte[] hashBytes = md5.ComputeHash(inputBytes); + + StringBuilder sb = new StringBuilder(); + foreach (byte b in hashBytes) + { + sb.Append(b.ToString("X2")); + } + return sb.ToString(); + } + } + + // Получение сессии + private async Task GetSessionAsync(string server, string user, string password) + { + // 1. Challenge запрос + var challengeRequest = new + { + method = "global.login", + @params = new + { + userName = user, + password = "", + clientType = "Web3.0" + }, + id = 1, + session = (string)null + }; + + string json = JsonSerializer.Serialize(challengeRequest); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + + var response = await _httpClient.PostAsync($"http://{server}/RPC2_Login", content); + response.EnsureSuccessStatusCode(); + + var responseJson = await response.Content.ReadAsStringAsync(); + using JsonDocument doc = JsonDocument.Parse(responseJson); + var root = doc.RootElement; + + if (!root.TryGetProperty("result", out var resultProp) || resultProp.GetBoolean()) + throw new Exception("Не удалось получить challenge"); + + string realm = root.GetProperty("params").GetProperty("realm").GetString(); + string random = root.GetProperty("params").GetProperty("random").GetString(); + string session = root.GetProperty("session").GetString(); + + // 2. Вычисление пароля + string pwdHash = CalculateMD5($"{user}:{realm}:{password}"); + string passHash = CalculateMD5($"{user}:{random}:{pwdHash}"); + + // 3. Авторизация + var authRequest = new + { + method = "global.login", + @params = new + { + userName = user, + clientType = "Web3.0", + authorityType = "Default", + passwordType = "Default", + password = passHash + }, + id = 2, + session = session + }; + + json = JsonSerializer.Serialize(authRequest); + content = new StringContent(json, Encoding.UTF8, "application/json"); + + response = await _httpClient.PostAsync($"http://{server}/RPC2_Login", content); + response.EnsureSuccessStatusCode(); + + responseJson = await response.Content.ReadAsStringAsync(); + using JsonDocument authDoc = JsonDocument.Parse(responseJson); + var authRoot = authDoc.RootElement; + + if (!authRoot.TryGetProperty("result", out resultProp) || !resultProp.GetBoolean()) + throw new Exception("Ошибка авторизации"); + + return authRoot.GetProperty("session").GetString(); + } + + // Получение состояния диска + public async Task CheckDiskStatusAsync(string server, int diskNumber, string user, string password) + { + try + { + // Получаем сессию + string session = await GetSessionAsync(server, user, password); + + // Запрос информации о дисках + var diskRequest = new + { + method = "storage.getTankInfo", + @params = (object)null, + id = 270, + session + }; + + string json = JsonSerializer.Serialize(diskRequest); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + + var response = await _httpClient.PostAsync($"http://{server}/RPC2", content); + response.EnsureSuccessStatusCode(); + + var responseJson = await response.Content.ReadAsStringAsync(); + var listDisk = Newtonsoft.Json.JsonConvert.DeserializeObject(responseJson).@params.tank[0].Device; + if (diskNumber != 0) + { + // Парсим ответ для поиска диска + string diskStatus = ParseDiskInfo(responseJson, diskNumber); + return diskStatus ?? "NotFound"; + } + else + { + int countDiskWithError = 0; + for (int i = 0; i < listDisk.Count - 2; i++) + { + if (listDisk[i].PreDiskCheck != "Good" && listDisk[i].PreDiskCheck != "Warn") + countDiskWithError++; + } + return countDiskWithError.ToString(); + } + } + catch (HttpRequestException ex) + { + throw new Exception($"Ошибка сети: {ex.Message}"); + } + catch (Exception ex) + { + throw new Exception($"Ошибка: {ex.Message}"); + } + } + + // Парсинг информации о дисках + private string ParseDiskInfo(string jsonResponse, int diskNumber) + { + using JsonDocument doc = JsonDocument.Parse(jsonResponse); + var root = doc.RootElement; + + // Проверяем успешность запроса + if (!root.TryGetProperty("result", out var resultProp) || !resultProp.GetBoolean()) + return null; + + // Ищем диски + if (!root.TryGetProperty("params", out var paramsProp)) + return null; + + if (!paramsProp.TryGetProperty("tank", out var tanksProp)) + return null; + + // Перебираем все массивы танков (хранилищ) + foreach (var tank in tanksProp.EnumerateArray()) + { + if (!tank.TryGetProperty("Device", out var devicesProp)) + continue; + + // Перебираем устройства в танке + foreach (var device in devicesProp.EnumerateArray()) + { + // Если устройство - строка (как в вашем примере) + if (device.ValueKind == JsonValueKind.String) + { + string deviceStr = device.GetString(); + if (deviceStr.Contains($"PhysicNo={diskNumber}")) + { + // Ищем PreDiskCheck + int start = deviceStr.IndexOf("PreDiskCheck="); + if (start == -1) return "Unknown"; + + start += "PreDiskCheck=".Length; + int end = deviceStr.IndexOf(';', start); + if (end == -1) end = deviceStr.Length; + + return deviceStr.Substring(start, end - start).Trim(); + } + } + // Если устройство - объект + else if (device.ValueKind == JsonValueKind.Object) + { + // Пробуем получить PhysicNo как строку или число + string physicNo = null; + if (device.TryGetProperty("PhysicNo", out var physicNoProp)) + { + if (physicNoProp.ValueKind == JsonValueKind.String) + { + physicNo = physicNoProp.GetString(); + } + else if (physicNoProp.ValueKind == JsonValueKind.Number) + { + physicNo = physicNoProp.GetInt32().ToString(); + } + } + + // Если нашли нужный диск + if (physicNo == diskNumber.ToString()) + { + // Получаем статус + if (device.TryGetProperty("PreDiskCheck", out var statusProp)) + { + return statusProp.GetString() ?? "Unknown"; + } + return "Unknown"; + } + } + } + } + + return null; + } + } + + + // Классы для десериализации JSON + + public class DahuaResponse + { + [JsonPropertyName("result")] + public bool Result { get; set; } + + [JsonPropertyName("session")] + public string Session { get; set; } + + [JsonPropertyName("params")] + public T Params { get; set; } + + [JsonPropertyName("error")] + public ErrorInfo Error { get; set; } + + [JsonPropertyName("id")] + public int Id { get; set; } + } + + public class ChallengeData + { + [JsonPropertyName("authorization")] + public string Authorization { get; set; } + + [JsonPropertyName("random")] + public string Random { get; set; } + + [JsonPropertyName("realm")] + public string Realm { get; set; } + + [JsonPropertyName("opaque")] + public string Opaque { get; set; } + } + + public class AuthData + { + [JsonPropertyName("keepAliveInterval")] + public int KeepAliveInterval { get; set; } + + [JsonPropertyName("isPwdOverdue")] + public bool IsPwdOverdue { get; set; } + } + + public class TankInfoData + { + [JsonPropertyName("tank")] + public List Tanks { get; set; } + } + + public class Tank + { + [JsonPropertyName("Device")] + public List Devices { get; set; } + + [JsonPropertyName("FreeSpace")] + public double FreeSpace { get; set; } + + [JsonPropertyName("Level")] + public int Level { get; set; } + + [JsonPropertyName("SlotNum")] + public int SlotNum { get; set; } + + [JsonPropertyName("TankNo")] + public int TankNo { get; set; } + + [JsonPropertyName("Temperature")] + public double Temperature { get; set; } + + [JsonPropertyName("TotalSpace")] + public double TotalSpace { get; set; } + } + + public class Device + { + [JsonPropertyName("PhysicNo")] + public string PhysicNo { get; set; } + + [JsonPropertyName("PreDiskCheck")] + public string PreDiskCheck { get; set; } + + [JsonPropertyName("Name")] + public string Name { get; set; } + + [JsonPropertyName("SerialNo")] + public string SerialNo { get; set; } + + [JsonPropertyName("Temperature")] + public string Temperature { get; set; } + + [JsonPropertyName("State")] + public string State { get; set; } + } + + public class ErrorInfo + { + [JsonPropertyName("code")] + public int Code { get; set; } + + [JsonPropertyName("message")] + public string Message { get; set; } + } +} \ No newline at end of file diff --git a/CheckEVS/test.json b/CheckEVS/test.json new file mode 100644 index 0000000..d76517b --- /dev/null +++ b/CheckEVS/test.json @@ -0,0 +1,913 @@ +{ + "id": 270, + "params": { + "tank": [ + { + "Device": [ + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sda", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 10, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EWD", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdb", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 12, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019E1D", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdc", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 11, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EZE", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdd", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 16, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019E0F", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 27, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sde", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 15, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019EWB", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdf", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 13, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019E3B", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdg", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 9, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019E1P", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdh", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 5, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019E1L", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdi", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 1, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EVN", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdj", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 6, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019E3G", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SND0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdk", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 2, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EGM", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdl", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 4, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EVM", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdm", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 3, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EBK", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdn", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 8, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019E2J", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdo", + "OpState": 0, + "Parent": "\/dev\/md0", + "Partitions": [], + "PhysicNo": 7, + "PosLedState": 0, + "PowerMode": "StandBy", + "PreDiskCheck": "Good", + "SerialNo": "WP019EBQ", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdp", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 20, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019EZK", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 29, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdq", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 19, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019E3P", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 29, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdr", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 24, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019E4H", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sds", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 23, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019E3Q", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdt", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 22, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019EVD", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdu", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 14, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Warn", + "SerialNo": "WP019EWH", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdv", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 18, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019EZM", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 30, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdw", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 21, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019EWL", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 28, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "SATA", + "Capacity": 9999757606912.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Firmware": "SNE0", + "LogicNo": 0, + "MRType": 0, + "Media": "DISK", + "MediaType": "HDD", + "Module": "ST10000VE0012KX101", + "Name": "\/dev\/sdx", + "OpState": 0, + "Parent": "\/dev\/md1", + "Partitions": [], + "PhysicNo": 17, + "PosLedState": 0, + "PowerMode": "Active", + "PreDiskCheck": "Good", + "SerialNo": "WP019E0H", + "State": "Sync", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Temperature": 30, + "UseMode": 0, + "Volume": "RaidVolume" + }, + { + "BUS": "", + "Capacity": 109997332054016.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Name": "\/dev\/md0", + "OpState": 0, + "Parent": null, + "Partitions": [ + { + "FileSystem": "PVDISK", + "IsSupportFs": false, + "Name": "\/dev\/md0", + "Start": 0, + "Total": 3219603456 + } + ], + "Raid": { + "ActiveDevices": 12, + "AliasName": "RAID5_1", + "ChunkSize": 16, + "FailedDevices": 0, + "Level": 5, + "MemberInfos": [ + { + "ID": 8, + "Spare": false + }, + { + "ID": 11, + "Spare": false + }, + { + "ID": 4, + "Spare": false + }, + { + "ID": 10, + "Spare": false + }, + { + "ID": 6, + "Spare": false + }, + { + "ID": 5, + "Spare": false + }, + { + "ID": 7, + "Spare": false + }, + { + "ID": 3, + "Spare": false + }, + { + "ID": 12, + "Spare": false + }, + { + "ID": 2, + "Spare": false + }, + { + "ID": 1, + "Spare": false + }, + { + "ID": 9, + "Spare": false + } + ], + "Members": [ "\/dev\/sdn", "\/dev\/sdc", "\/dev\/sdl", "\/dev\/sda", "\/dev\/sdj", "\/dev\/sdh", "\/dev\/sdo", "\/dev\/sdm", "\/dev\/sdb", "\/dev\/sdk", "\/dev\/sdi", "\/dev\/sdg" ], + "RaidDevices": 12, + "RecoverMBps": 0.0, + "RecoverPercent": 0.0, + "RecoverTimeRemain": 0, + "SpareDevices": 0, + "State": [ "Active", "CreatVG" ], + "Sync": 0, + "TotalDevices": 12, + "UUID": "2cb254ea:b401130a:6e9e714d:ffc1de04", + "WorkingDevices": 12 + }, + "State": "Active", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Volume": "VolumeGroup" + }, + { + "BUS": "", + "Capacity": 109997332054016.0, + "CmrSize": 0, + "DRTypeMixState": "Single", + "Name": "\/dev\/md1", + "OpState": 0, + "Parent": null, + "Partitions": [ + { + "FileSystem": "PVDISK", + "IsSupportFs": false, + "Name": "\/dev\/md1", + "Start": 0, + "Total": 3219603456 + } + ], + "Raid": { + "ActiveDevices": 12, + "AliasName": "RAID5_2", + "ChunkSize": 16, + "FailedDevices": 0, + "Level": 5, + "MemberInfos": [ + { + "ID": 17, + "Spare": false + }, + { + "ID": 15, + "Spare": false + }, + { + "ID": 18, + "Spare": false + }, + { + "ID": 22, + "Spare": false + }, + { + "ID": 24, + "Spare": false + }, + { + "ID": 20, + "Spare": false + }, + { + "ID": 13, + "Spare": false + }, + { + "ID": 21, + "Spare": false + }, + { + "ID": 16, + "Spare": false + }, + { + "ID": 14, + "Spare": false + }, + { + "ID": 23, + "Spare": false + }, + { + "ID": 19, + "Spare": false + } + ], + "Members": [ "\/dev\/sdx", "\/dev\/sde", "\/dev\/sdv", "\/dev\/sdt", "\/dev\/sdr", "\/dev\/sdp", "\/dev\/sdf", "\/dev\/sdw", "\/dev\/sdd", "\/dev\/sdu", "\/dev\/sds", "\/dev\/sdq" ], + "RaidDevices": 12, + "RecoverMBps": 0.0, + "RecoverPercent": 0.0, + "RecoverTimeRemain": 0, + "SpareDevices": 0, + "State": [ "Active", "CreatVG" ], + "Sync": 0, + "TotalDevices": 12, + "UUID": "9a7e6e86:180ea46a:b19dd6f2:cb6a4e62", + "WorkingDevices": 12 + }, + "State": "Active", + "Tank": { + "Level": 0, + "Slot": 0, + "TankNo": 0 + }, + "Volume": "VolumeGroup" + } + ], + "FreeSpace": 0.0, + "Level": 0, + "SlotNum": 24, + "TankNo": 0, + "Temperature": 0.0, + "TotalSpace": 0.0 + } + ] + }, + "result": true, + "session": "b62094f5c75a79c4a690dcc52ab8d365" +} diff --git a/CheckTimeHikvision/App.config b/CheckTimeHikvision/App.config new file mode 100644 index 0000000..193aecc --- /dev/null +++ b/CheckTimeHikvision/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CheckTimeHikvision/CheckTimeHikvision.csproj b/CheckTimeHikvision/CheckTimeHikvision.csproj new file mode 100644 index 0000000..143cf89 --- /dev/null +++ b/CheckTimeHikvision/CheckTimeHikvision.csproj @@ -0,0 +1,96 @@ + + + + + Debug + AnyCPU + {5CBD52DC-CABA-426B-9B32-1583F10F60A2} + Exe + CheckTimeHikvision + CheckTimeHikvision + v4.8 + 512 + true + true + false + \\172.16.48.150\shara\algorius\myapps\GetCurrentTimeIPC\TimeHikvision\ + true + Unc + false + Foreground + 7 + Days + false + false + true + true + publish.htm + 1 + 1.0.0.%2a + false + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + B6A785D6AB34D0981DD89243D25F9969F436678B + + + CheckTimeHikvision_TemporaryKey.pfx + + + true + + + true + + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4.8 %28x86 и x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/CheckTimeHikvision/Program.cs b/CheckTimeHikvision/Program.cs new file mode 100644 index 0000000..82631f1 --- /dev/null +++ b/CheckTimeHikvision/Program.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; + +namespace CheckTimeHikvision +{ + internal class Program + { + static async Task Main(string[] args) + { +#if DEBUG + args = new string[4]; + args[0] = "update"; + args[1] = "172.16.50.151"; + args[2] = "admin"; + args[3] = "4NUDZhJ7"; +#endif + string server, login, password; + if (args.Length != 4) return; + server = args[1]; + login = args[2]; + password = args[3]; + + switch (args[0]) + { + case "check": + string baseUrl = $"http://{server}"; + var credCache = new CredentialCache(); + credCache.Add(new Uri(baseUrl), "Digest", new NetworkCredential(login, password)); + using (var handler = new HttpClientHandler + { + Credentials = credCache, + //ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true + }) + using (var httpClient = new HttpClient(handler)) + { + string requestUrl = $"{baseUrl}/ISAPI/System/time/localTime"; + var response = await httpClient.GetAsync(requestUrl); + try + { + response.EnsureSuccessStatusCode(); + } + catch (Exception) + { + Console.WriteLine("1"); + return; + } + var r = await response.Content.ReadAsStringAsync(); + var r2 = Convert.ToDateTime(r); + if (r2 <= DateTime.Now.AddMinutes(2) && r2 >= DateTime.Now.AddMinutes(-2)) + Console.WriteLine("0"); + else Console.WriteLine("1"); + } + break; + case "update": + string baseUrlU = $"http://{server}"; + var credCacheU = new CredentialCache(); + credCacheU.Add(new Uri(baseUrlU), "Digest", new NetworkCredential(login, password)); + using (var handler = new HttpClientHandler + { + Credentials = credCacheU, + ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true + }) + using (var httpClient = new HttpClient(handler)) + { + string requestUrl = $"{baseUrlU}/ISAPI/System/time"; + + string xmlBody = $@""; + + // Создаем контент для PUT запроса + var content = new StringContent(xmlBody, Encoding.UTF8, "application/xml"); + + // Выполняем PUT запрос + var response = await httpClient.PutAsync(requestUrl, content); + try + { + response.EnsureSuccessStatusCode(); + } + catch (Exception) + { + Console.WriteLine("1"); + return; + } + var r = await response.Content.ReadAsStringAsync(); + //r = r.Replace("\r\n", ""); + if (r.StartsWith("OK")) + { + Console.WriteLine("0"); + } + else Console.WriteLine("1"); + } + break; + default: + break; + } + + + + } + } +} diff --git a/CheckTimeHikvision/Properties/AssemblyInfo.cs b/CheckTimeHikvision/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a0610f8 --- /dev/null +++ b/CheckTimeHikvision/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанные с этой сборкой. +[assembly: AssemblyTitle("CheckTimeHikvision")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CheckTimeHikvision")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// из модели COM задайте для атрибута ComVisible этого типа значение true. +[assembly: ComVisible(false)] + +// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM +[assembly: Guid("5cbd52dc-caba-426b-9b32-1583f10f60a2")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Номер редакции +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ChekTimeDahua/ChekTimeDahua.csproj b/ChekTimeDahua/ChekTimeDahua.csproj new file mode 100644 index 0000000..dfadba7 --- /dev/null +++ b/ChekTimeDahua/ChekTimeDahua.csproj @@ -0,0 +1,11 @@ + + + + Exe + net8.0 + enable + enable + + + + diff --git a/ChekTimeDahua/Program.cs b/ChekTimeDahua/Program.cs new file mode 100644 index 0000000..c7e7d39 --- /dev/null +++ b/ChekTimeDahua/Program.cs @@ -0,0 +1,90 @@ +using System.Net; + +namespace ChekTimeDahua +{ + internal class Program + { + static async Task Main(string[] args) + { +#if DEBUG + args = new string[4]; + args[0] = "check"; + args[1] = "172.16.50.14"; + args[2] = "admin"; + args[3] = "4NUDZhJ7"; +#endif + string server, login, password; + if (args.Length != 4) return; + server = args[1]; + login = args[2]; + password = args[3]; + + + switch (args[0]) + { + case "check": + string baseUrl = $"http://{server}"; + var credCache = new CredentialCache(); + credCache.Add(new Uri(baseUrl), "Digest", new NetworkCredential(login, password)); + using (var handler = new HttpClientHandler + { + Credentials = credCache, + ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true + }) + using (var httpClient = new HttpClient(handler)) + { + string requestUrl = $"{baseUrl}/cgi-bin/global.cgi?action=getCurrentTime"; + var response = await httpClient.GetAsync(requestUrl); + try + { + response.EnsureSuccessStatusCode(); + } + catch (Exception) + { + Console.WriteLine("1"); + return; + } + var r = await response.Content.ReadAsStringAsync(); + var r2 = Convert.ToDateTime(r.Split("=")[1]); + if (r2 <= DateTime.Now.AddMinutes(2) && r2 >= DateTime.Now.AddMinutes(-2)) + Console.WriteLine("0"); + else Console.WriteLine("1"); + } + break; + case "update": + string baseUrlU = $"http://{server}"; + var credCacheU = new CredentialCache(); + credCacheU.Add(new Uri(baseUrlU), "Digest", new NetworkCredential(login, password)); + using (var handler = new HttpClientHandler + { + Credentials = credCacheU, + ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true + }) + using (var httpClient = new HttpClient(handler)) + { + string requestUrl = $"{baseUrlU}/cgi-bin/global.cgi?action=setCurrentTime&time={DateTime.Now:yyyy-MM-dd HH:mm:ss}"; + var response = await httpClient.GetAsync(requestUrl); + try + { + response.EnsureSuccessStatusCode(); + } + catch (Exception) + { + Console.WriteLine("1"); + return; + } + var r = await response.Content.ReadAsStringAsync(); + //r = r.Replace("\r\n", ""); + if (r.StartsWith("OK")) + { + Console.WriteLine("0"); + } + else Console.WriteLine("1"); + } + break; + default: + break; + } + } + } +} diff --git a/DahuaIPCRename/DahuaIPCRename.csproj b/DahuaIPCRename/DahuaIPCRename.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/DahuaIPCRename/DahuaIPCRename.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/DahuaIPCRename/Program.cs b/DahuaIPCRename/Program.cs new file mode 100644 index 0000000..2fb4eda --- /dev/null +++ b/DahuaIPCRename/Program.cs @@ -0,0 +1,48 @@ +using System.Net; + +namespace DahuaIPCRename +{ + internal class Program + { + public static Dictionary listIPC = new Dictionary + { + {"172.22.10.221","Домофон|Глав.вход"}, + {"172.22.10.222","Домофон|Линкор"}, + {"172.22.10.223","Домофон|НЛК-1"}, + {"172.22.10.224","Домофон|НЛК-2"}, + {"172.22.10.225","Домофон|Ленмикс"}, + {"172.22.10.226","Домофон|Карбон"} + }; + + static async Task Main(string[] args) + { + foreach (var ipc in listIPC) + { + string baseUrl = $"http://{ipc.Key}"; + var credCache = new CredentialCache(); + credCache.Add(new Uri(baseUrl), "Digest", new NetworkCredential("admin", "4NUDZhJ7")); + using (var handler = new HttpClientHandler + { + Credentials = credCache, + ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true + }) + using (var httpClient = new HttpClient(handler)) + { + string requestUrl = $"{baseUrl}/cgi-bin/configManager.cgi?action=setConfig&ChannelTitle[0].Name={ipc.Value}"; + var response = await httpClient.GetAsync(requestUrl); + try + { + response.EnsureSuccessStatusCode(); + Console.WriteLine($"{ipc.Key}\tOK\t{ipc.Value}"); + } + catch (Exception) + { + Console.WriteLine($"{ipc.Key}\tNO\t{ipc.Value}"); + return; + } + } + } + Console.ReadKey(); + } + } +} diff --git a/LICENSE b/LICENSE index d9ba34b..5735ebe 100644 --- a/LICENSE +++ b/LICENSE @@ -219,8 +219,8 @@ If you develop a new program, and you want it to be of the greatest possible use To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - work - Copyright (C) 2026 astankovmi + lcsoft + Copyright (C) 2026 admin This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/README.md b/README.md index a991381..6ba79de 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# work - +# lsSoft \ No newline at end of file diff --git a/SwitchDahua/Form1.Designer.cs b/SwitchDahua/Form1.Designer.cs new file mode 100644 index 0000000..17d9791 --- /dev/null +++ b/SwitchDahua/Form1.Designer.cs @@ -0,0 +1,229 @@ +namespace SwitchDahua +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + groupBox1 = new GroupBox(); + button1 = new Button(); + comboBox1 = new ComboBox(); + statusConnect = new Label(); + label3 = new Label(); + label2 = new Label(); + label1 = new Label(); + textBox3 = new TextBox(); + textBox2 = new TextBox(); + tabControl1 = new TabControl(); + tabPage1 = new TabPage(); + textBox4 = new TextBox(); + tabPage2 = new TabPage(); + textBox5 = new TextBox(); + groupBox1.SuspendLayout(); + tabControl1.SuspendLayout(); + tabPage1.SuspendLayout(); + tabPage2.SuspendLayout(); + SuspendLayout(); + // + // groupBox1 + // + groupBox1.Controls.Add(button1); + groupBox1.Controls.Add(comboBox1); + groupBox1.Controls.Add(statusConnect); + groupBox1.Controls.Add(label3); + groupBox1.Controls.Add(label2); + groupBox1.Controls.Add(label1); + groupBox1.Controls.Add(textBox3); + groupBox1.Controls.Add(textBox2); + groupBox1.Location = new Point(12, 12); + groupBox1.Name = "groupBox1"; + groupBox1.Size = new Size(713, 60); + groupBox1.TabIndex = 0; + groupBox1.TabStop = false; + groupBox1.Text = "groupBox1"; + // + // button1 + // + button1.Location = new Point(571, 18); + button1.Name = "button1"; + button1.Size = new Size(96, 23); + button1.TabIndex = 3; + button1.Text = "Подключиться"; + button1.UseVisualStyleBackColor = true; + button1.Click += button1_Click; + // + // comboBox1 + // + comboBox1.FormattingEnabled = true; + comboBox1.Items.AddRange(new object[] { "172.16.48.9\tkr0-1-sw1", "172.16.48.10\tkr0-1-sw2", "172.16.48.11\tkr0-1-sw3", "172.16.48.12\tkr0-1-sw4", "172.16.48.13\tkr0-2-sw1", "172.16.48.14\tkr0-2-sw2", "172.16.48.15\tkr0-2-sw3", "172.16.48.16\tkr0-2-sw4", "172.16.48.17\tkr1_sw1", "172.16.48.18\tkr1_sw2", "172.16.48.19\tkr1_sw3", "172.16.48.20\tkr1_sw4", "172.16.48.21\tkr1_sw5", "172.16.48.22\tkr1_sw6", "172.16.48.23\tkr2-sw1", "172.16.48.24\tkr2-sw2", "172.16.48.25\tkr2-sw3", "172.16.48.26\tkr2-sw4", "172.16.48.27\tkr2-sw5", "172.16.48.28\tkr2-sw6", "172.16.48.29\tkr2-sw7", "172.16.48.30\tkr2-sw8", "172.16.48.31\tkr3-sw1", "172.16.48.32\tkr3-sw2", "172.16.48.33\tkr3-sw3", "172.16.48.34\tkr3-sw4", "172.16.48.35\tkr3-sw5", "172.16.48.36\tkr3-sw6", "172.16.48.37\tkr4-sw1", "172.16.48.38\tkr4-sw2", "172.16.48.39\tkr4-sw3", "172.16.48.40\tkr4-sw4", "172.16.48.41\tkr4-sw5", "172.16.48.42\tkr4-sw6", "172.16.48.43\tkr4-sw7", "172.16.48.44\tkr4-sw8", "172.16.48.45\tkr5-sw1", "172.16.48.46\tkr6-sw1", "172.16.48.47\tkr6-sw2", "172.16.48.48\tkr7-sw1", "172.16.48.49\tkr7-sw2", "172.16.48.50\tkr8-sw1", "172.16.48.51\tkr8-sw2", "172.16.48.52\tkr9-sw1", "172.16.48.53\tkr10-sw1", "172.16.48.54\tkr10-sw2", "172.16.48.55\tkr10-sw3", "172.16.48.56\tkr11-sw1", "172.16.48.57\tkr11-sw2", "172.16.48.58\tkr11-sw3", "172.16.48.59\tkr11-sw4", "172.16.48.60\tkr12-sw1", "172.16.48.61\tkr12-sw2", "172.16.48.62\tkr13-sw1", "172.16.48.63\tkr13-sw2", "172.16.48.64\tkr14-sw1", "172.16.48.65\tkr14-sw2", "172.16.48.66\tkr15-sw1", "172.16.48.67\tkr15-sw2", "172.16.48.68\tkr15-sw3", "172.16.48.69\tkr15-sw4", "172.16.48.70\tkr16-sw1", "172.16.48.71\tkr16-sw2", "172.16.48.72\tkr16-sw3", "172.16.48.73\tkr16-sw4", "172.16.48.74\tkr16-sw5", "172.16.48.75\tkr16-sw6", "172.16.48.76\tkr2_sw9", "172.16.48.77\tsw_rum111", "172.16.48.78\tkr15_sw5" }); + comboBox1.Location = new Point(32, 20); + comboBox1.Name = "comboBox1"; + comboBox1.Size = new Size(147, 21); + comboBox1.TabIndex = 2; + comboBox1.Text = "172.16.48.9\tkr0-1-sw1"; + comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; + // + // statusConnect + // + statusConnect.AutoSize = true; + statusConnect.Location = new Point(673, 23); + statusConnect.Name = "statusConnect"; + statusConnect.Size = new Size(31, 13); + statusConnect.TabIndex = 2; + statusConnect.Text = "✅❎"; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new Point(370, 23); + label3.Name = "label3"; + label3.Size = new Size(48, 13); + label3.TabIndex = 2; + label3.Text = "Пароль:"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(185, 23); + label2.Name = "label2"; + label2.Size = new Size(37, 13); + label2.TabIndex = 2; + label2.Text = "Логин"; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new Point(6, 23); + label1.Name = "label1"; + label1.Size = new Size(21, 13); + label1.TabIndex = 1; + label1.Text = "IP:"; + // + // textBox3 + // + textBox3.Location = new Point(422, 20); + textBox3.Name = "textBox3"; + textBox3.PasswordChar = '#'; + textBox3.Size = new Size(127, 21); + textBox3.TabIndex = 0; + textBox3.Text = "4NUDZhJ7"; + // + // textBox2 + // + textBox2.Location = new Point(226, 20); + textBox2.Name = "textBox2"; + textBox2.Size = new Size(127, 21); + textBox2.TabIndex = 0; + textBox2.Text = "admin"; + // + // tabControl1 + // + tabControl1.Controls.Add(tabPage1); + tabControl1.Controls.Add(tabPage2); + tabControl1.Font = new Font("Tahoma", 12F); + tabControl1.Location = new Point(12, 78); + tabControl1.Name = "tabControl1"; + tabControl1.SelectedIndex = 0; + tabControl1.Size = new Size(713, 690); + tabControl1.TabIndex = 1; + // + // tabPage1 + // + tabPage1.Controls.Add(textBox4); + tabPage1.Location = new Point(4, 22); + tabPage1.Name = "tabPage1"; + tabPage1.Padding = new Padding(3); + tabPage1.Size = new Size(705, 664); + tabPage1.TabIndex = 0; + tabPage1.Text = "LLDP"; + tabPage1.UseVisualStyleBackColor = true; + // + // textBox4 + // + textBox4.Font = new Font("Tahoma", 12F); + textBox4.Location = new Point(6, 6); + textBox4.Multiline = true; + textBox4.Name = "textBox4"; + textBox4.ScrollBars = ScrollBars.Vertical; + textBox4.Size = new Size(693, 652); + textBox4.TabIndex = 0; + // + // tabPage2 + // + tabPage2.Controls.Add(textBox5); + tabPage2.Location = new Point(4, 28); + tabPage2.Name = "tabPage2"; + tabPage2.Padding = new Padding(3); + tabPage2.Size = new Size(705, 658); + tabPage2.TabIndex = 1; + tabPage2.Text = "MAC"; + tabPage2.UseVisualStyleBackColor = true; + // + // textBox5 + // + textBox5.Location = new Point(6, 6); + textBox5.Multiline = true; + textBox5.Name = "textBox5"; + textBox5.Size = new Size(693, 397); + textBox5.TabIndex = 0; + // + // Form1 + // + AutoScaleDimensions = new SizeF(6F, 13F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(734, 780); + Controls.Add(tabControl1); + Controls.Add(groupBox1); + Name = "Form1"; + Text = "Form1"; + groupBox1.ResumeLayout(false); + groupBox1.PerformLayout(); + tabControl1.ResumeLayout(false); + tabPage1.ResumeLayout(false); + tabPage1.PerformLayout(); + tabPage2.ResumeLayout(false); + tabPage2.PerformLayout(); + ResumeLayout(false); + } + + #endregion + + private GroupBox groupBox1; + private Label label1; + private Button button1; + private Label label3; + private Label label2; + private TextBox textBox3; + private TextBox textBox2; + private Label statusConnect; + private TabControl tabControl1; + private TabPage tabPage1; + private TextBox textBox4; + private TabPage tabPage2; + private TextBox textBox5; + private ComboBox comboBox1; + } +} diff --git a/SwitchDahua/Form1.cs b/SwitchDahua/Form1.cs new file mode 100644 index 0000000..8be5d0e --- /dev/null +++ b/SwitchDahua/Form1.cs @@ -0,0 +1,212 @@ +using Microsoft.VisualBasic.ApplicationServices; +using Newtonsoft.Json; +using System.Net.Http; +using System.Security.Cryptography; +using System.Text; +using System.Text.Json; + +namespace SwitchDahua +{ + public partial class Form1 : Form + { + private readonly HttpClient _httpClient; + private string server, user, password, session; + private int token; + public Form1() + { + InitializeComponent(); + var handler = new HttpClientHandler + { + ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true + }; + server = "172.16.48.9"; + _httpClient = new HttpClient(handler); + _httpClient.Timeout = TimeSpan.FromSeconds(30); + + + } + + private string CalculateMD5(string input) + { + using (MD5 md5 = MD5.Create()) + { + byte[] inputBytes = Encoding.UTF8.GetBytes(input); + byte[] hashBytes = md5.ComputeHash(inputBytes); + + StringBuilder sb = new StringBuilder(); + foreach (byte b in hashBytes) + { + sb.Append(b.ToString("X2")); + } + return sb.ToString(); + } + } + + private async Task GetSessionAsync(string server, string user, string password) + { + // 1. Challenge + var challengeRequest = new + { + method = "global.login", + @params = new + { + userName = user, + password = "", + clientType = "Web3.0" + }, + id = 1, + session = (string)null + }; + + string json = System.Text.Json.JsonSerializer.Serialize(challengeRequest); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + + var response = await _httpClient.PostAsync($"http://{server}/RPC2_Login", content); + response.EnsureSuccessStatusCode(); + + var responseJson = await response.Content.ReadAsStringAsync(); + using JsonDocument doc = JsonDocument.Parse(responseJson); + var root = doc.RootElement; + + if (!root.TryGetProperty("result", out var resultProp) || resultProp.GetBoolean()) + throw new Exception(" challenge"); + + string realm = root.GetProperty("params").GetProperty("realm").GetString(); + string random = root.GetProperty("params").GetProperty("random").GetString(); + string session = root.GetProperty("session").GetString(); + + // 2. + string pwdHash = CalculateMD5($"{user}:{realm}:{password}"); + string passHash = CalculateMD5($"{user}:{random}:{pwdHash}"); + + // 3. + var authRequest = new + { + method = "global.login", + @params = new + { + userName = user, + clientType = "Web3.0", + authorityType = "Default", + passwordType = "Default", + password = passHash + }, + id = 2, + session = session + }; + + json = System.Text.Json.JsonSerializer.Serialize(authRequest); + content = new StringContent(json, Encoding.UTF8, "application/json"); + + response = await _httpClient.PostAsync($"http://{server}/RPC2_Login", content); + response.EnsureSuccessStatusCode(); + + responseJson = await response.Content.ReadAsStringAsync(); + using JsonDocument authDoc = JsonDocument.Parse(responseJson); + var authRoot = authDoc.RootElement; + + if (!authRoot.TryGetProperty("result", out resultProp) || !resultProp.GetBoolean()) + throw new Exception(" "); + + return authRoot.GetProperty("session").GetString(); + } + + private async void button1_Click(object sender, EventArgs e) + { + comboBox1.SelectionStart = 0; + user = textBox2.Text; + password = textBox3.Text; + session = await GetSessionAsync(server, user, password); + + await GetLLDP(); + await GetMacTable(); + // + } + + private async Task GetMacTable() + { + var portRequest = new + { + method = "PortManager.startFindMac", + @params = new + { + Condition = new object() // + }, + id = 270, // + session // + }; + + string json = System.Text.Json.JsonSerializer.Serialize(portRequest); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + + var response = await _httpClient.PostAsync($"http://{server}/RPC2", content); + response.EnsureSuccessStatusCode(); + + var responseJson = await response.Content.ReadAsStringAsync(); + MAC1 ListDev = JsonConvert.DeserializeObject(responseJson); + token = ListDev.Params.Token; + + var MacRequest = new + { + method = "PortManager.doFindMac", + @params = new + { + Count = 24, + Offset = 0, + Token = token + }, + id = 270, // + session // + }; + string json2 = System.Text.Json.JsonSerializer.Serialize(MacRequest); + var content2 = new StringContent(json2, Encoding.UTF8, "application/json"); + + var response2 = await _httpClient.PostAsync($"http://{server}/RPC2", content2); + response2.EnsureSuccessStatusCode(); + + var responseJson2 = await response2.Content.ReadAsStringAsync(); + MAC ListDev2 = JsonConvert.DeserializeObject(responseJson2); + var listMac = ListDev2.Params.Info; + string txt2 = string.Empty; + foreach (var dev in listMac) + { + txt2 += dev.PortID + "\t" + dev.MAC + Environment.NewLine; + } + textBox5.Text = txt2; + } + + private async Task GetLLDP() + { + var diskRequest = new + { + method = "LLDPManager.getLLDPNeighborsInfo", + @params = (object)null, + id = 270, + session + }; + + string json = System.Text.Json.JsonSerializer.Serialize(diskRequest); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + + var response = await _httpClient.PostAsync($"http://{server}/RPC2", content); + response.EnsureSuccessStatusCode(); + + var responseJson = await response.Content.ReadAsStringAsync(); + LLDP ListDev = JsonConvert.DeserializeObject(responseJson); + + string txt = string.Empty; + foreach (var dev in ListDev.Params) + { + txt += dev.LocalInterface.Substring(dev.LocalInterface.LastIndexOf('/') + 1) + "\t" + dev.ManagerIP + Environment.NewLine; + } + textBox4.Text = txt; + } + + private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) + { + var t = comboBox1.Items[comboBox1.SelectedIndex].ToString(); + t = t.Substring(0,t.Length - (t.Length - t.IndexOf("\t"))); + server = t; + } + } +} diff --git a/SwitchDahua/Form1.resx b/SwitchDahua/Form1.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/SwitchDahua/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SwitchDahua/LLDP.cs b/SwitchDahua/LLDP.cs new file mode 100644 index 0000000..9b4fa62 --- /dev/null +++ b/SwitchDahua/LLDP.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SwitchDahua +{ + public class LLDP + { + public int id { get; set; } + public List? Params { get; set; } + public bool result { get; set; } + public string? session { get; set; } + } + public class ParamLLDP + { + public string? LocalInterface { get; set; } + public string? ManagerIP { get; set; } + public string? PortDescribe { get; set; } + public string? PortID { get; set; } + public string? SysAbility { get; set; } + public string? SysName { get; set; } + } + public class Condition + { + } + + public class ParamsMAC1 + { + public int Count { get; set; } + public int Token { get; set; } + } + + public class MAC1 + { + public int id { get; set; } + public ParamsMAC1 Params { get; set; } + public bool result { get; set; } + public string session { get; set; } + } + + public class InfoMAC + { + public int KeepState { get; set; } + public string MAC { get; set; } + public int PortID { get; set; } + public int PortType { get; set; } + public int Type { get; set; } + public int VlanID { get; set; } + } + + public class ParamsMAC + { + public List Info { get; set; } + } + + public class MAC + { + public int id { get; set; } + public ParamsMAC Params { get; set; } + public bool result { get; set; } + public string session { get; set; } + } +} diff --git a/SwitchDahua/Program.cs b/SwitchDahua/Program.cs new file mode 100644 index 0000000..0ac757e --- /dev/null +++ b/SwitchDahua/Program.cs @@ -0,0 +1,17 @@ +namespace SwitchDahua +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/SwitchDahua/SwitchDahua.csproj b/SwitchDahua/SwitchDahua.csproj new file mode 100644 index 0000000..34a9e96 --- /dev/null +++ b/SwitchDahua/SwitchDahua.csproj @@ -0,0 +1,15 @@ + + + + WinExe + net8.0-windows + enable + true + enable + + + + + + + \ No newline at end of file diff --git a/Wiking/Controllers/TestController.cs b/Wiking/Controllers/TestController.cs new file mode 100644 index 0000000..f0e351f --- /dev/null +++ b/Wiking/Controllers/TestController.cs @@ -0,0 +1,71 @@ +using Microsoft.AspNetCore.Mvc; + +[ApiController] +[Route("api/[controller]")] +public class TestController : ControllerBase +{ + [HttpGet] + [Produces("text/html")] + public ContentResult GetSchema() + { + var html = @" + + + + + Схема подключения + + + +
+

Схема подключения устройства

+

Эта страница возвращается из Web API контроллера

+ +
+
Маршрутизатор
+
+
Коммутатор
+
+
+
Сервер
+
Компьютер 1
+
Компьютер 2
+
+
+
+ +

Время генерации: " + DateTime.Now.ToString("HH:mm:ss") + @"

+
+ +"; + + return Content(html, "text/html; charset=utf-8"); + } +} \ No newline at end of file diff --git a/Wiking/Controllers/WeatherForecastController.cs b/Wiking/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..a5cd2f4 --- /dev/null +++ b/Wiking/Controllers/WeatherForecastController.cs @@ -0,0 +1,62 @@ +using Microsoft.AspNetCore.Mvc; +using System.Net; +using System.Net.Http.Headers; + +namespace Wiking.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + + [HttpGet] + [Route("api/schema")] + public HttpResponseMessage GetHtmlPage() + { + var htmlContent = @" + + + + + + +

+

HTML , WebApi

+
+ +"; + + var response = new HttpResponseMessage(HttpStatusCode.OK); + response.Content = new StringContent(htmlContent); + response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html"); + + return response; + } + } +} diff --git a/Wiking/Program.cs b/Wiking/Program.cs new file mode 100644 index 0000000..9194da6 --- /dev/null +++ b/Wiking/Program.cs @@ -0,0 +1,36 @@ + +namespace Wiking +{ + public class Program + { + public static void Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); + + // Add services to the container. + + builder.Services.AddControllers(); + // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle + builder.Services.AddEndpointsApiExplorer(); + builder.Services.AddSwaggerGen(); + + var app = builder.Build(); + + // Configure the HTTP request pipeline. + if (app.Environment.IsDevelopment()) + { + app.UseSwagger(); + app.UseSwaggerUI(); + } + + app.UseHttpsRedirection(); + + app.UseAuthorization(); + + + app.MapControllers(); + + app.Run(); + } + } +} diff --git a/Wiking/Properties/launchSettings.json b/Wiking/Properties/launchSettings.json new file mode 100644 index 0000000..f7fafee --- /dev/null +++ b/Wiking/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:60191", + "sslPort": 44339 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://192.168.1.228:5292", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://192.168.1.228:7189;http://192.168.1.228:5292", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Wiking/WeatherForecast.cs b/Wiking/WeatherForecast.cs new file mode 100644 index 0000000..b4f7a6a --- /dev/null +++ b/Wiking/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace Wiking +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/Wiking/Wiking.csproj b/Wiking/Wiking.csproj new file mode 100644 index 0000000..b4cf06c --- /dev/null +++ b/Wiking/Wiking.csproj @@ -0,0 +1,19 @@ + + + + net8.0 + enable + enable + + + + + + + + + Always + + + + diff --git a/Wiking/Wiking.http b/Wiking/Wiking.http new file mode 100644 index 0000000..f04d595 --- /dev/null +++ b/Wiking/Wiking.http @@ -0,0 +1,6 @@ +@Wiking_HostAddress = http://localhost:5292 + +GET {{Wiking_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/Wiking/appsettings.Development.json b/Wiking/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Wiking/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Wiking/appsettings.json b/Wiking/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Wiking/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/Wiking/htmlpage.html b/Wiking/htmlpage.html new file mode 100644 index 0000000..5638b72 --- /dev/null +++ b/Wiking/htmlpage.html @@ -0,0 +1,475 @@ + + + + + + Схема подключения устройства + + + + +
+
+

Схема подключения устройства

+

Интерактивная схема подключения сетевого оборудования

+
+ +
+
+

Схема подключения

+
+ +
+
+
+
+ + +
+ + Маршрутизатор +
+ +
+ + Сетевой коммутатор +
+ +
+ + Рабочая станция +
+ +
+ + Сервер +
+ +
+ + Основное устройство +
+
+
+ +
+

Инструкция по подключению

+
    +
  1. +

    Подготовка оборудования

    +

    Убедитесь, что все устройства выключены. Проверьте наличие всех необходимых кабелей и аксессуаров.

    +
  2. +
  3. +

    Подключение маршрутизатора

    +

    Соедините WAN-порт маршрутизатора с кабелем интернет-провайдера. Подключите блок питания к маршрутизатору.

    +
  4. +
  5. +

    Подключение коммутатора

    +

    Соедините LAN-порт маршрутизатора с любым портом сетевого коммутатора с помощью патч-корда.

    +
  6. +
  7. +

    Подключение устройств

    +

    Подключите рабочую станцию, сервер и основное устройство к свободным портам коммутатора.

    +
  8. +
  9. +

    Настройка и проверка

    +

    Включите все устройства. Проверьте индикацию на каждом устройстве и убедитесь в наличии сетевого соединения.

    +
  10. +
+
+
+ +
+
+

Технические характеристики

+
+ Тип подключения: + Ethernet 1000BASE-T +
+
+ Скорость передачи: + до 1 Гбит/с +
+
+ Тип кабеля: + CAT 5e/6/6a +
+
+ Макс. длина кабеля: + 100 метров +
+
+ Протоколы: + TCP/IP, DHCP, DNS +
+
+ +
+

Необходимые компоненты

+
+ Маршрутизатор: + 1 шт. +
+
+ Сетевой коммутатор: + 1 шт. (8 портов) +
+
+ Патч-корды: + 4 шт. +
+
+ Сетевые карты: + встроенные +
+
+ Блоки питания: + 4 шт. +
+
+
+ +
+

Схема подключения устройства | Создано для наглядного представления сетевой инфраструктуры

+

© 2023 Все права защищены. При использовании схемы убедитесь в соответствии техническим требованиям.

+
+
+ + + + \ No newline at end of file diff --git a/lsConsole/Program.cs b/lsConsole/Program.cs new file mode 100644 index 0000000..3241338 --- /dev/null +++ b/lsConsole/Program.cs @@ -0,0 +1,122 @@ +using Renci.SshNet; +using System; + +Dictionary listSw = new Dictionary +{ + {"GE1/0/1", "kr1_sw1"}, + {"GE1/0/2", "kr1_sw2"}, + {"GE1/0/3", "kr1_sw3"}, + {"GE1/0/4", "kr1_sw4"}, + {"GE1/0/5", "kr1_sw5"}, + {"GE1/0/6", "kr1_sw6"}, + {"GE1/0/7", "kr2_sw1"}, + {"GE1/0/8", "kr2_sw2"}, + {"GE1/0/9", "kr2_sw3"}, + {"GE1/0/10", "kr2_sw4"}, + {"GE1/0/11", "kr2_sw5"}, + {"GE1/0/12", "kr2_sw6"}, + {"GE1/0/13", "kr2_sw7"}, + {"GE1/0/14", "kr2_sw8"}, + {"GE1/0/15", "kr2_sw9"}, + {"GE1/0/16", "kr3_sw2"}, + {"GE1/0/17", "kr3_sw1"}, + {"GE1/0/18", "kr3_sw3"}, + {"GE1/0/19", "kr3_sw4"}, + {"GE1/0/20", "kr3_sw5"}, + {"GE1/0/21", "kr3_sw6"}, + {"GE1/0/22", "kr4_sw1"}, + {"GE1/0/23", "kr4_sw2"}, + {"GE1/0/24", "kr4_sw3"}, + {"GE2/0/1", "kr4_sw4"}, + {"GE2/0/2", "kr4_sw5"}, + {"GE2/0/3", "kr4_sw6"}, + {"GE2/0/4", "kr4_sw7"}, + {"GE2/0/5", "kr4_sw8"}, + {"GE2/0/6", "kr5_sw1"}, + {"GE2/0/7", "kr6_sw1"}, + {"GE2/0/8", "kr6_sw2"}, + {"GE2/0/9", "kr7_sw1"}, + {"GE2/0/10", "kr7_sw2"}, + {"GE2/0/11", "kr8_sw1"}, + {"GE2/0/12", "kr8_sw2"}, + {"GE2/0/13", "kr9_sw1"}, + {"GE2/0/14", "kr10_sw1"}, + {"GE2/0/15", "kr10_sw2"}, + {"GE2/0/16", "kr10_sw3"}, + {"GE2/0/17", "kr11_sw1"}, + {"GE2/0/18", "kr11_sw2"}, + {"GE2/0/19", "kr11_sw3"}, + {"GE2/0/20", "kr11_sw4"}, + {"GE2/0/21", "kr12_sw1"}, + {"GE2/0/22", "kr12_sw2"}, + {"GE2/0/23", "kr13_sw1"}, + {"GE2/0/24", "kr14_sw1"}, + {"GE3/0/1", "kr14_sw2"}, + {"GE3/0/2", "kr13_sw2"}, + {"GE3/0/3", "kr15_sw1"}, + {"GE3/0/4", "kr15_sw3"}, + {"GE3/0/5", "kr15_sw2"}, + {"GE3/0/6", "kr15_sw4"}, + {"GE3/0/7", "kr15_sw5"}, + {"GE3/0/8", "kr16_sw1"}, + {"GE3/0/9", "kr16_sw2"}, + {"GE3/0/10", "kr16_sw3"}, + {"GE3/0/11", "kr16_sw4"}, + {"GE3/0/12", "kr16_sw5"}, + {"GE3/0/13", "kr16_sw6"}, + {"GE3/0/14", "kr0_1_sw1"}, + {"GE3/0/15", "kr0_1_sw2"}, + {"GE3/0/16", "kr0_1_sw3"}, + {"GE3/0/17", "kr0_1_sw4"}, + {"GE3/0/18", "kr00_2_sw1"}, + {"GE3/0/19", "kr00_2_sw2"}, + {"GE3/0/20", "kr00_2_sw3"}, + {"GE3/0/21", "kr0_2_sw4"} +}; +List listMac = new List() +{ +"2959", +"5c09", +"2827", +"84e8", +"848d", +"8413", +"88a0", +"0db0", +"8b4e" +}; + +string host = "172.16.48.4"; +string username = "admin"; +string password = "4NUDZhJ789"; +int port = 22; // стандартный порт SSH + +using (var client = new SshClient(host, port, username, password)) +{ + try + { + // Подключаемся + client.Connect(); + Console.WriteLine("Подключение установлено!"); + + foreach (var mac in listMac) + { + var command = client.RunCommand($"show mac-address | include {mac}"); + var otvet = command.Result.Split("\r\n")[1].Substring(45, 8); + Console.WriteLine(listSw[otvet]); + } + Console.ReadKey(); + } + catch (Exception ex) + { + Console.WriteLine($"Ошибка: {ex.Message}"); + } + finally + { + if (client.IsConnected) + { + client.Disconnect(); + Console.WriteLine("Отключено."); + } + } +} \ No newline at end of file diff --git a/lsConsole/listCam.csv b/lsConsole/listCam.csv new file mode 100644 index 0000000..e4bb5fc --- /dev/null +++ b/lsConsole/listCam.csv @@ -0,0 +1,790 @@ +172.16.51.2 +172.16.51.3 +172.16.51.4 +172.16.51.5 +172.16.51.6 +172.16.51.7 +172.16.51.8 +172.16.51.9 +172.16.51.10 +172.16.51.11 +172.16.51.12 +172.16.51.13 +172.16.51.14 +172.16.51.15 +172.16.51.16 +172.16.51.17 +172.16.51.18 +172.16.51.19 +172.16.51.20 +172.16.51.21 +172.16.51.22 +172.16.51.23 +172.16.51.24 +172.16.51.25 +172.16.51.26 +172.16.51.27 +172.16.51.28 +172.16.51.29 +172.16.51.30 +172.16.51.31 +172.16.51.32 +172.16.51.33 +172.16.51.34 +172.16.51.35 +172.16.51.36 +172.16.51.37 +172.16.51.38 +172.16.51.39 +172.16.51.40 +172.16.51.41 +172.16.51.42 +172.16.51.43 +172.16.51.44 +172.16.51.45 +172.16.51.46 +172.16.51.47 +172.16.51.48 +172.16.51.49 +172.16.51.50 +172.16.51.51 +172.16.51.52 +172.16.51.53 +172.16.51.54 +172.16.51.55 +172.16.51.56 +172.16.51.57 +172.16.51.58 +172.16.51.59 +172.16.51.60 +172.16.51.61 +172.16.51.62 +172.16.51.63 +172.16.51.64 +172.16.51.65 +172.16.51.66 +172.16.51.67 +172.16.51.68 +172.16.51.69 +172.16.51.70 +172.16.51.71 +172.16.51.72 +172.16.51.73 +172.16.51.74 +172.16.51.75 +172.16.51.76 +172.16.51.77 +172.16.51.78 +172.16.51.79 +172.16.51.80 +172.16.51.81 +172.16.51.82 +172.16.51.83 +172.16.51.84 +172.16.51.85 +172.16.51.86 +172.16.51.87 +172.16.51.88 +172.16.51.89 +172.16.51.90 +172.16.51.91 +172.16.51.92 +172.16.51.93 +172.16.51.94 +172.16.51.95 +172.16.51.96 +172.16.51.97 +172.16.51.98 +172.16.51.99 +172.16.51.100 +172.16.51.101 +172.16.51.102 +172.16.51.103 +172.16.51.104 +172.16.51.105 +172.16.51.106 +172.16.51.107 +172.16.51.108 +172.16.51.109 +172.16.51.110 +172.16.51.111 +172.16.51.112 +172.16.51.113 +172.16.51.114 +172.16.51.115 +172.16.51.116 +172.16.51.117 +172.16.51.118 +172.16.51.119 +172.16.51.120 +172.16.51.121 +172.16.51.122 +172.16.51.123 +172.16.51.124 +172.16.51.125 +172.16.51.126 +172.16.51.127 +172.16.51.128 +172.16.51.129 +172.16.51.130 +172.16.51.131 +172.16.51.132 +172.16.51.133 +172.16.51.134 +172.16.51.135 +172.16.51.136 +172.16.51.137 +172.16.51.138 +172.16.51.139 +172.16.51.140 +172.16.51.141 +172.16.51.142 +172.16.51.143 +172.16.51.144 +172.16.51.145 +172.16.51.146 +172.16.51.147 +172.16.51.148 +172.16.51.149 +172.16.51.150 +172.16.51.151 +172.16.51.152 +172.16.51.153 +172.16.51.154 +172.16.51.155 +172.16.51.156 +172.16.51.157 +172.16.51.158 +172.16.51.159 +172.16.51.160 +172.16.51.161 +172.16.51.162 +172.16.51.163 +172.16.51.164 +172.16.51.165 +172.16.51.166 +172.16.51.167 +172.16.51.168 +172.16.51.169 +172.16.51.170 +172.16.51.171 +172.16.51.172 +172.16.51.173 +172.16.51.174 +172.16.51.175 +172.16.51.176 +172.16.51.177 +172.16.51.178 +172.16.51.179 +172.16.51.180 +172.16.51.181 +172.16.51.182 +172.16.51.183 +172.16.51.184 +172.16.51.185 +172.16.51.186 +172.16.51.187 +172.16.51.188 +172.16.51.189 +172.16.51.190 +172.16.51.191 +172.16.51.192 +172.16.51.193 +172.16.51.194 +172.16.51.195 +172.16.51.196 +172.16.51.197 +172.16.51.198 +172.16.51.199 +172.16.51.200 +172.16.51.201 +172.16.51.202 +172.16.51.203 +172.16.51.204 +172.16.51.205 +172.16.51.206 +172.16.51.207 +172.16.51.208 +172.16.51.209 +172.16.51.210 +172.16.51.211 +172.16.51.212 +172.16.51.213 +172.16.51.214 +172.16.51.215 +172.16.51.216 +172.16.51.217 +172.16.51.218 +172.16.51.219 +172.16.51.220 +172.16.51.221 +172.16.51.222 +172.16.51.223 +172.16.51.224 +172.16.51.225 +172.16.51.226 +172.16.51.227 +172.16.51.228 +172.16.51.229 +172.16.51.230 +172.16.51.231 +172.16.51.232 +172.16.51.233 +172.16.51.234 +172.16.51.235 +172.16.51.236 +172.16.51.237 +172.16.51.238 +172.16.51.239 +172.16.51.240 +172.16.51.241 +172.16.51.242 +172.16.51.243 +172.16.51.244 +172.16.51.245 +172.16.51.246 +172.16.51.247 +172.16.51.248 +172.16.51.249 +172.16.51.250 +172.16.51.251 +172.16.51.252 +172.16.51.253 +172.16.51.254 +172.16.51.255 +172.16.52.1 +172.16.52.2 +172.16.52.3 +172.16.52.4 +172.16.52.5 +172.16.52.6 +172.16.52.7 +172.16.52.8 +172.16.52.9 +172.16.52.10 +172.16.52.11 +172.16.52.12 +172.16.52.13 +172.16.52.14 +172.16.52.15 +172.16.52.16 +172.16.52.17 +172.16.52.18 +172.16.52.19 +172.16.52.20 +172.16.52.21 +172.16.52.22 +172.16.52.23 +172.16.52.24 +172.16.52.25 +172.16.52.26 +172.16.52.27 +172.16.52.28 +172.16.52.29 +172.16.52.30 +172.16.52.31 +172.16.52.32 +172.16.52.33 +172.16.52.34 +172.16.52.35 +172.16.52.36 +172.16.52.37 +172.16.52.38 +172.16.52.39 +172.16.52.40 +172.16.52.41 +172.16.52.42 +172.16.52.43 +172.16.52.44 +172.16.52.45 +172.16.52.46 +172.16.52.47 +172.16.52.48 +172.16.52.49 +172.16.52.50 +172.16.52.51 +172.16.52.52 +172.16.52.53 +172.16.52.54 +172.16.52.55 +172.16.52.56 +172.16.52.57 +172.16.52.58 +172.16.52.59 +172.16.52.60 +172.16.52.61 +172.16.52.62 +172.16.52.63 +172.16.52.64 +172.16.52.65 +172.16.52.66 +172.16.52.67 +172.16.52.68 +172.16.52.69 +172.16.52.70 +172.16.52.71 +172.16.52.72 +172.16.52.73 +172.16.52.74 +172.16.52.75 +172.16.52.76 +172.16.52.77 +172.16.52.78 +172.16.52.79 +172.16.52.80 +172.16.52.81 +172.16.52.82 +172.16.52.83 +172.16.52.84 +172.16.52.85 +172.16.52.86 +172.16.52.87 +172.16.52.88 +172.16.52.89 +172.16.52.90 +172.16.52.91 +172.16.52.92 +172.16.52.93 +172.16.52.94 +172.16.52.95 +172.16.52.96 +172.16.52.97 +172.16.52.98 +172.16.52.99 +172.16.52.100 +172.16.52.101 +172.16.52.102 +172.16.52.103 +172.16.52.104 +172.16.52.105 +172.16.52.106 +172.16.52.107 +172.16.52.108 +172.16.52.109 +172.16.52.110 +172.16.52.111 +172.16.52.112 +172.16.52.113 +172.16.52.114 +172.16.52.115 +172.16.52.116 +172.16.52.117 +172.16.52.118 +172.16.52.119 +172.16.52.120 +172.16.52.121 +172.16.52.122 +172.16.52.123 +172.16.52.124 +172.16.52.125 +172.16.52.126 +172.16.52.127 +172.16.52.128 +172.16.52.129 +172.16.52.130 +172.16.52.131 +172.16.52.132 +172.16.52.133 +172.16.52.134 +172.16.52.135 +172.16.52.136 +172.16.52.137 +172.16.52.138 +172.16.52.139 +172.16.52.140 +172.16.52.141 +172.16.52.142 +172.16.52.143 +172.16.52.144 +172.16.52.145 +172.16.52.146 +172.16.52.147 +172.16.52.148 +172.16.52.149 +172.16.52.150 +172.16.52.151 +172.16.52.152 +172.16.52.153 +172.16.52.154 +172.16.52.155 +172.16.52.156 +172.16.52.157 +172.16.52.158 +172.16.52.159 +172.16.52.160 +172.16.52.161 +172.16.52.162 +172.16.52.163 +172.16.52.164 +172.16.52.165 +172.16.52.166 +172.16.52.167 +172.16.52.168 +172.16.52.169 +172.16.52.170 +172.16.52.171 +172.16.52.172 +172.16.52.173 +172.16.52.174 +172.16.52.175 +172.16.52.176 +172.16.52.177 +172.16.52.178 +172.16.52.179 +172.16.52.180 +172.16.52.181 +172.16.52.182 +172.16.52.183 +172.16.52.184 +172.16.52.185 +172.16.52.186 +172.16.52.187 +172.16.52.188 +172.16.52.189 +172.16.52.190 +172.16.52.191 +172.16.52.192 +172.16.52.193 +172.16.52.194 +172.16.52.195 +172.16.52.196 +172.16.52.197 +172.16.52.198 +172.16.52.199 +172.16.52.200 +172.16.52.201 +172.16.52.202 +172.16.52.203 +172.16.52.204 +172.16.52.205 +172.16.52.206 +172.16.52.207 +172.16.52.208 +172.16.52.209 +172.16.52.210 +172.16.52.211 +172.16.52.212 +172.16.52.213 +172.16.52.214 +172.16.52.215 +172.16.52.216 +172.16.52.217 +172.16.52.218 +172.16.52.219 +172.16.52.220 +172.16.52.221 +172.16.52.222 +172.16.52.223 +172.16.52.224 +172.16.52.225 +172.16.52.226 +172.16.52.227 +172.16.52.228 +172.16.52.229 +172.16.52.230 +172.16.52.231 +172.16.52.232 +172.16.52.233 +172.16.52.234 +172.16.52.235 +172.16.52.236 +172.16.52.237 +172.16.52.238 +172.16.52.239 +172.16.52.240 +172.16.52.241 +172.16.52.242 +172.16.52.243 +172.16.52.244 +172.16.52.245 +172.16.52.246 +172.16.52.247 +172.16.52.248 +172.16.52.249 +172.16.52.250 +172.16.52.251 +172.16.52.252 +172.16.52.253 +172.16.52.254 +172.16.52.255 +172.16.53.1 +172.16.53.2 +172.16.53.3 +172.16.53.4 +172.16.53.5 +172.16.53.6 +172.16.53.7 +172.16.53.8 +172.16.53.9 +172.16.53.10 +172.16.53.11 +172.16.53.12 +172.16.53.13 +172.16.53.14 +172.16.53.15 +172.16.53.16 +172.16.53.17 +172.16.53.18 +172.16.53.19 +172.16.53.20 +172.16.53.21 +172.16.53.22 +172.16.53.23 +172.16.53.24 +172.16.53.25 +172.16.53.26 +172.16.53.27 +172.16.53.28 +172.16.53.29 +172.16.53.30 +172.16.53.31 +172.16.53.32 +172.16.53.33 +172.16.53.34 +172.16.53.35 +172.16.53.36 +172.16.53.37 +172.16.53.38 +172.16.53.39 +172.16.53.40 +172.16.53.41 +172.16.53.42 +172.16.53.43 +172.16.53.44 +172.16.53.45 +172.16.53.46 +172.16.53.47 +172.16.53.48 +172.16.53.49 +172.16.53.50 +172.16.53.51 +172.16.53.52 +172.16.53.53 +172.16.53.54 +172.16.53.55 +172.16.53.56 +172.16.53.57 +172.16.53.58 +172.16.53.59 +172.16.53.60 +172.16.53.61 +172.16.53.62 +172.16.53.63 +172.16.53.64 +172.16.53.65 +172.16.53.66 +172.16.53.67 +172.16.53.68 +172.16.53.69 +172.16.53.70 +172.16.53.71 +172.16.53.72 +172.16.53.73 +172.16.53.74 +172.16.53.75 +172.16.53.76 +172.16.53.77 +172.16.53.78 +172.16.53.79 +172.16.53.80 +172.16.53.81 +172.16.53.82 +172.16.53.83 +172.16.53.84 +172.16.53.85 +172.16.53.86 +172.16.53.87 +172.16.53.88 +172.16.53.89 +172.16.53.90 +172.16.53.91 +172.16.53.92 +172.16.53.93 +172.16.53.94 +172.16.53.95 +172.16.53.96 +172.16.53.97 +172.16.53.98 +172.16.53.99 +172.16.53.100 +172.16.53.101 +172.16.53.102 +172.16.53.103 +172.16.53.104 +172.16.53.105 +172.16.53.106 +172.16.53.107 +172.16.53.108 +172.16.53.109 +172.16.53.110 +172.16.53.111 +172.16.53.112 +172.16.53.113 +172.16.53.114 +172.16.53.115 +172.16.53.116 +172.16.53.117 +172.16.53.118 +172.16.53.119 +172.16.53.120 +172.16.53.121 +172.16.53.122 +172.16.53.123 +172.16.53.124 +172.16.53.125 +172.16.53.126 +172.16.53.127 +172.16.53.128 +172.16.53.129 +172.16.53.130 +172.16.53.131 +172.16.53.132 +172.16.53.133 +172.16.53.134 +172.16.53.135 +172.16.53.136 +172.16.53.137 +172.16.53.138 +172.16.53.139 +172.16.53.140 +172.16.53.141 +172.16.53.142 +172.16.53.143 +172.16.53.144 +172.16.53.145 +172.16.53.146 +172.16.53.147 +172.16.53.148 +172.16.53.149 +172.16.53.150 +172.16.53.151 +172.16.53.152 +172.16.53.153 +172.16.53.154 +172.16.53.155 +172.16.53.156 +172.16.53.157 +172.16.53.158 +172.16.53.159 +172.16.53.160 +172.16.53.161 +172.16.53.162 +172.16.53.163 +172.16.53.164 +172.16.53.165 +172.16.53.166 +172.16.53.167 +172.16.53.168 +172.16.53.169 +172.16.53.170 +172.16.53.171 +172.16.53.172 +172.16.53.173 +172.16.53.174 +172.16.53.175 +172.16.53.176 +172.16.53.177 +172.16.53.178 +172.16.53.179 +172.16.53.180 +172.16.53.181 +172.16.53.182 +172.16.53.183 +172.16.53.184 +172.16.53.185 +172.16.53.186 +172.16.53.187 +172.16.53.188 +172.16.53.189 +172.16.53.190 +172.16.53.191 +172.16.53.192 +172.16.53.193 +172.16.53.194 +172.16.53.195 +172.16.53.196 +172.16.53.197 +172.16.53.198 +172.16.53.199 +172.16.53.200 +172.16.53.201 +172.16.53.202 +172.16.53.203 +172.16.53.204 +172.16.53.205 +172.16.53.206 +172.16.53.207 +172.16.53.208 +172.16.53.209 +172.16.53.210 +172.16.53.211 +172.16.53.212 +172.16.53.213 +172.16.53.214 +172.16.53.215 +172.16.53.216 +172.16.53.217 +172.16.53.218 +172.16.53.219 +172.16.53.220 +172.16.53.221 +172.16.53.222 +172.16.53.223 +172.16.53.224 +172.16.53.225 +172.16.53.226 +172.16.53.227 +172.16.53.228 +172.16.53.229 +172.16.53.230 +172.16.53.231 +172.16.53.232 +172.16.53.233 +172.16.53.234 +172.16.53.235 +172.16.53.236 +172.16.53.237 +172.16.53.238 +172.16.53.239 +172.16.53.240 +172.16.53.241 +172.16.53.242 +172.16.53.243 +172.16.53.244 +172.16.53.245 +172.16.53.246 +172.16.53.247 +172.16.53.248 +172.16.53.249 +172.16.53.250 +172.16.53.251 +172.16.53.252 +172.16.53.253 +172.16.53.254 +172.16.53.254 +172.16.54.1 +172.16.54.2 +172.16.54.3 +172.16.54.4 +172.16.54.5 +172.16.54.6 +172.16.54.7 +172.16.54.8 +172.16.54.9 +172.16.54.10 +172.16.54.11 +172.16.54.12 +172.16.54.13 +172.16.54.14 +172.16.54.15 +172.16.54.16 +172.16.54.17 +172.16.54.18 +172.16.54.19 +172.16.54.20 +172.16.54.21 +172.16.54.22 +172.16.54.23 +172.16.54.24 +172.16.54.25 +172.16.54.26 \ No newline at end of file diff --git a/lsConsole/lsConsole.csproj b/lsConsole/lsConsole.csproj new file mode 100644 index 0000000..5dbcbaf --- /dev/null +++ b/lsConsole/lsConsole.csproj @@ -0,0 +1,20 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + Always + + + + diff --git a/lsSoft.slnx b/lsSoft.slnx new file mode 100644 index 0000000..7ccff76 --- /dev/null +++ b/lsSoft.slnx @@ -0,0 +1,10 @@ + + + + + + + + + +