This commit is contained in:
@@ -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
|
||||
+2
-4
@@ -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
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="ListDev.csv" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="ListDev.csv">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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
|
||||
|
@@ -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<KeyValuePair<string, string>> ListDev = new List<KeyValuePair<string, string>>();
|
||||
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<string>();
|
||||
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<string> 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<TokenResponse>();
|
||||
return data?.Token.ToString();
|
||||
}
|
||||
|
||||
return "null";
|
||||
}
|
||||
|
||||
public static async Task<string> 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<KeyValuePair<string, string>> 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<string, string>(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<string> 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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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<Partition> 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> 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<MemberInfo> MemberInfos { get; set; }
|
||||
public List<string> 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<string> 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> 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; }
|
||||
}
|
||||
}
|
||||
@@ -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 <IP> <номер_диска> [пользователь] [пароль]");
|
||||
//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 <IP> <номер_диска> ║");
|
||||
Console.WriteLine("║ Вернет статус запрошенного диска ║");
|
||||
Console.WriteLine("║ ║");
|
||||
Console.WriteLine("║ DahuaDiskChecker.exe <IP> 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<string> 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<string> 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<Disks>(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<T>
|
||||
{
|
||||
[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<Tank> Tanks { get; set; }
|
||||
}
|
||||
|
||||
public class Tank
|
||||
{
|
||||
[JsonPropertyName("Device")]
|
||||
public List<JsonElement> 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; }
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{5CBD52DC-CABA-426B-9B32-1583F10F60A2}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>CheckTimeHikvision</RootNamespace>
|
||||
<AssemblyName>CheckTimeHikvision</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>\\172.16.48.150\shara\algorius\myapps\GetCurrentTimeIPC\TimeHikvision\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Unc</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.htm</WebPage>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestCertificateThumbprint>B6A785D6AB34D0981DD89243D25F9969F436678B</ManifestCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestKeyFile>CheckTimeHikvision_TemporaryKey.pfx</ManifestKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateManifests>true</GenerateManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignManifests>true</SignManifests>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="CheckTimeHikvision_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.8 %28x86 и x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -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 = $@"<?xml version=""1.0"" encoding=""UTF-8""?><Time><timeMode>manual</timeMode><localTime>{DateTime.Now:yyyy-MM-ddTHH:mm:ss}</localTime><timeZone>CST-3:00:00</timeZone></Time>";
|
||||
|
||||
// Создаем контент для 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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")]
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Net;
|
||||
|
||||
namespace DahuaIPCRename
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
public static Dictionary<string, string> listIPC = new Dictionary<string, string>
|
||||
{
|
||||
{"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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
|
||||
Generated
+229
@@ -0,0 +1,229 @@
|
||||
namespace SwitchDahua
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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<string> 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<MAC1>(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<MAC>(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<LLDP>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -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<ParamLLDP>? 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<InfoMAC> 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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace SwitchDahua
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -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 = @"
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>Схема подключения</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 40px;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #2c3e50;
|
||||
border-bottom: 3px solid #3498db;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.node {
|
||||
background: #3498db;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
margin: 10px;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='container'>
|
||||
<h1>Схема подключения устройства</h1>
|
||||
<p>Эта страница возвращается из Web API контроллера</p>
|
||||
|
||||
<div style='text-align: center; margin: 30px 0;'>
|
||||
<div class='node'>Маршрутизатор</div>
|
||||
<div style='margin: 20px;'>↓</div>
|
||||
<div class='node'>Коммутатор</div>
|
||||
<div style='margin: 20px; display: flex; justify-content: space-around;'>
|
||||
<div>
|
||||
<div class='node'>Сервер</div>
|
||||
<div class='node'>Компьютер 1</div>
|
||||
<div class='node'>Компьютер 2</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><strong>Время генерации:</strong> " + DateTime.Now.ToString("HH:mm:ss") + @"</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
return Content(html, "text/html; charset=utf-8");
|
||||
}
|
||||
}
|
||||
@@ -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<WeatherForecastController> _logger;
|
||||
|
||||
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetWeatherForecast")]
|
||||
public IEnumerable<WeatherForecast> 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 = @"<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Ñõåìà ïîäêëþ÷åíèÿ</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 40px; }
|
||||
h1 { color: #333; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ñõåìà ïîäêëþ÷åíèÿ óñòðîéñòâà</h1>
|
||||
<p>Ýòî HTML ñòðàíèöà, âîçâðàùàåìàÿ èç WebApi êîíòðîëëåðà</p>
|
||||
<div>Çäåñü ìîæåò áûòü âàøà ñõåìà ïîäêëþ÷åíèÿ</div>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
var response = new HttpResponseMessage(HttpStatusCode.OK);
|
||||
response.Content = new StringContent(htmlContent);
|
||||
response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html");
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="htmlpage.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
@Wiking_HostAddress = http://localhost:5292
|
||||
|
||||
GET {{Wiking_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -0,0 +1,475 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Схема подключения устройства</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
padding: 20px;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #2c3e50;
|
||||
margin-bottom: 10px;
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #7f8c8d;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.diagram-container {
|
||||
flex: 1;
|
||||
min-width: 300px;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
padding: 25px;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.instructions {
|
||||
flex: 1;
|
||||
min-width: 300px;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
padding: 25px;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
color: #2c3e50;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid #3498db;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.section-title i {
|
||||
color: #3498db;
|
||||
}
|
||||
|
||||
.diagram {
|
||||
position: relative;
|
||||
height: 400px;
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 10px;
|
||||
border: 2px dashed #ddd;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.device {
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.device:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.device i {
|
||||
font-size: 30px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.device-name {
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.device-1 {
|
||||
top: 50px;
|
||||
left: 50px;
|
||||
border-top: 4px solid #e74c3c;
|
||||
}
|
||||
|
||||
.device-2 {
|
||||
top: 50px;
|
||||
right: 50px;
|
||||
border-top: 4px solid #3498db;
|
||||
}
|
||||
|
||||
.device-3 {
|
||||
bottom: 50px;
|
||||
left: 50px;
|
||||
border-top: 4px solid #2ecc71;
|
||||
}
|
||||
|
||||
.device-4 {
|
||||
bottom: 50px;
|
||||
right: 50px;
|
||||
border-top: 4px solid #f39c12;
|
||||
}
|
||||
|
||||
.device-5 {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-top: 4px solid #9b59b6;
|
||||
}
|
||||
|
||||
.connection {
|
||||
position: absolute;
|
||||
height: 4px;
|
||||
background-color: #3498db;
|
||||
z-index: 1;
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
.connection-1 {
|
||||
width: 120px;
|
||||
top: 100px;
|
||||
left: 160px;
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
.connection-2 {
|
||||
width: 120px;
|
||||
top: 100px;
|
||||
right: 160px;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.connection-3 {
|
||||
width: 120px;
|
||||
bottom: 100px;
|
||||
left: 160px;
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
.connection-4 {
|
||||
width: 120px;
|
||||
bottom: 100px;
|
||||
right: 160px;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.steps {
|
||||
list-style-type: none;
|
||||
counter-reset: step-counter;
|
||||
}
|
||||
|
||||
.step {
|
||||
margin-bottom: 20px;
|
||||
padding-left: 40px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.step:before {
|
||||
counter-increment: step-counter;
|
||||
content: counter(step-counter);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background-color: #3498db;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.step h3 {
|
||||
color: #2c3e50;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.step p {
|
||||
color: #555;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.details {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.detail-box {
|
||||
flex: 1;
|
||||
min-width: 250px;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.detail-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
color: #3498db;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
padding: 20px;
|
||||
color: #7f8c8d;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
background-color: #e8f4fc;
|
||||
padding: 3px 6px;
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.content {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.device {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.device-5 {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.device i {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.device-name {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.connection {
|
||||
height: 3px;
|
||||
}
|
||||
|
||||
.connection-1, .connection-2, .connection-3, .connection-4 {
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>Схема подключения устройства</h1>
|
||||
<p class="subtitle">Интерактивная схема подключения сетевого оборудования</p>
|
||||
</header>
|
||||
|
||||
<div class="content">
|
||||
<div class="diagram-container">
|
||||
<h2 class="section-title"><i class="fas fa-project-diagram"></i> Схема подключения</h2>
|
||||
<div class="diagram">
|
||||
<!-- Подключения -->
|
||||
<div class="connection connection-1"></div>
|
||||
<div class="connection connection-2"></div>
|
||||
<div class="connection connection-3"></div>
|
||||
<div class="connection connection-4"></div>
|
||||
|
||||
<!-- Устройства -->
|
||||
<div class="device device-1" data-device="router">
|
||||
<i class="fas fa-wifi"></i>
|
||||
<span class="device-name">Маршрутизатор</span>
|
||||
</div>
|
||||
|
||||
<div class="device device-2" data-device="switch">
|
||||
<i class="fas fa-network-wired"></i>
|
||||
<span class="device-name">Сетевой коммутатор</span>
|
||||
</div>
|
||||
|
||||
<div class="device device-3" data-device="pc">
|
||||
<i class="fas fa-desktop"></i>
|
||||
<span class="device-name">Рабочая станция</span>
|
||||
</div>
|
||||
|
||||
<div class="device device-4" data-device="server">
|
||||
<i class="fas fa-server"></i>
|
||||
<span class="device-name">Сервер</span>
|
||||
</div>
|
||||
|
||||
<div class="device device-5" data-device="main">
|
||||
<i class="fas fa-hdd"></i>
|
||||
<span class="device-name">Основное устройство</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="instructions">
|
||||
<h2 class="section-title"><i class="fas fa-list-ol"></i> Инструкция по подключению</h2>
|
||||
<ol class="steps">
|
||||
<li class="step">
|
||||
<h3>Подготовка оборудования</h3>
|
||||
<p>Убедитесь, что все устройства выключены. Проверьте наличие всех необходимых кабелей и аксессуаров.</p>
|
||||
</li>
|
||||
<li class="step">
|
||||
<h3>Подключение маршрутизатора</h3>
|
||||
<p>Соедините WAN-порт маршрутизатора с кабелем интернет-провайдера. Подключите блок питания к маршрутизатору.</p>
|
||||
</li>
|
||||
<li class="step">
|
||||
<h3>Подключение коммутатора</h3>
|
||||
<p>Соедините LAN-порт маршрутизатора с любым портом сетевого коммутатора с помощью <span class="highlight">патч-корда</span>.</p>
|
||||
</li>
|
||||
<li class="step">
|
||||
<h3>Подключение устройств</h3>
|
||||
<p>Подключите рабочую станцию, сервер и основное устройство к свободным портам коммутатора.</p>
|
||||
</li>
|
||||
<li class="step">
|
||||
<h3>Настройка и проверка</h3>
|
||||
<p>Включите все устройства. Проверьте индикацию на каждом устройстве и убедитесь в наличии сетевого соединения.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
<div class="detail-box">
|
||||
<h2 class="section-title"><i class="fas fa-info-circle"></i> Технические характеристики</h2>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Тип подключения:</span>
|
||||
<span class="detail-value">Ethernet 1000BASE-T</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Скорость передачи:</span>
|
||||
<span class="detail-value">до 1 Гбит/с</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Тип кабеля:</span>
|
||||
<span class="detail-value">CAT 5e/6/6a</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Макс. длина кабеля:</span>
|
||||
<span class="detail-value">100 метров</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Протоколы:</span>
|
||||
<span class="detail-value">TCP/IP, DHCP, DNS</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-box">
|
||||
<h2 class="section-title"><i class="fas fa-tools"></i> Необходимые компоненты</h2>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Маршрутизатор:</span>
|
||||
<span class="detail-value">1 шт.</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Сетевой коммутатор:</span>
|
||||
<span class="detail-value">1 шт. (8 портов)</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Патч-корды:</span>
|
||||
<span class="detail-value">4 шт.</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Сетевые карты:</span>
|
||||
<span class="detail-value">встроенные</span>
|
||||
</div>
|
||||
<div class="detail-item">
|
||||
<span class="detail-label">Блоки питания:</span>
|
||||
<span class="detail-value">4 шт.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>Схема подключения устройства | Создано для наглядного представления сетевой инфраструктуры</p>
|
||||
<p>© 2023 Все права защищены. При использовании схемы убедитесь в соответствии техническим требованиям.</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Добавляем интерактивность для устройств
|
||||
document.querySelectorAll('.device').forEach(device => {
|
||||
device.addEventListener('click', function() {
|
||||
const deviceName = this.querySelector('.device-name').textContent;
|
||||
alert(`Вы выбрали: ${deviceName}\n\nЭто устройство подключено к основному устройству через сетевой коммутатор.`);
|
||||
});
|
||||
});
|
||||
|
||||
// Анимация подключений при загрузке страницы
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const connections = document.querySelectorAll('.connection');
|
||||
connections.forEach((conn, index) => {
|
||||
// Начальное состояние - линии невидимы
|
||||
conn.style.width = '0';
|
||||
|
||||
// Анимация появления линий с задержкой
|
||||
setTimeout(() => {
|
||||
conn.style.transition = 'width 1s ease-in-out';
|
||||
if (index === 0) conn.style.width = '120px';
|
||||
if (index === 1) conn.style.width = '120px';
|
||||
if (index === 2) conn.style.width = '120px';
|
||||
if (index === 3) conn.style.width = '120px';
|
||||
}, 300 + index * 300);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,122 @@
|
||||
using Renci.SshNet;
|
||||
using System;
|
||||
|
||||
Dictionary<string, string> listSw = new Dictionary<string, string>
|
||||
{
|
||||
{"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<string> listMac = new List<string>()
|
||||
{
|
||||
"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("Отключено.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SSH.NET" Version="2025.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="listCam.csv">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<Solution>
|
||||
<Project Path="AddHostToProxy/AddHostToProxy.csproj" Id="3dc81096-172f-420c-85b1-d7af5e6caf5c" />
|
||||
<Project Path="CheckEVS/CheckEVS.csproj" />
|
||||
<Project Path="CheckTimeHikvision/CheckTimeHikvision.csproj" Id="5cbd52dc-caba-426b-9b32-1583f10f60a2" />
|
||||
<Project Path="ChekTimeDahua/ChekTimeDahua.csproj" Id="e570bdbe-62ad-476b-b36c-5f6ecf3028b1" />
|
||||
<Project Path="DahuaIPCRename/DahuaIPCRename.csproj" Id="1e5671da-7b44-4818-8942-d73d2148c853" />
|
||||
<Project Path="lsConsole/lsConsole.csproj" />
|
||||
<Project Path="SwitchDahua/SwitchDahua.csproj" Id="12504b58-758f-444b-a79b-4ce2db8398cc" />
|
||||
<Project Path="Wiking/Wiking.csproj" Id="fa0eb4bd-8bfb-4873-bb71-1c2a608ab911" />
|
||||
</Solution>
|
||||
Reference in New Issue
Block a user