Update
Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## 17-02-2025
|
||||||
|
* Fix: Исправлен баг с проверкой ввода на пустоту или пробелы
|
||||||
|
* Refactor: Изменены регулярные выражения для форматирования имени ПК
|
||||||
|
* Refactor: Мелкие изменения информационных сообщений
|
||||||
|
|
||||||
## 26-01-2025
|
## 26-01-2025
|
||||||
* Feat: Добавлена функция отключения кошелька KDE (нужны тесты)
|
* Feat: Добавлена функция отключения кошелька KDE (нужны тесты)
|
||||||
* Feat: Добавлен файл settings.json с настройками для перезагрузки компьютеров по расписанию
|
* Feat: Добавлен файл settings.json с настройками для перезагрузки компьютеров по расписанию
|
||||||
|
|||||||
13
Program.cs
13
Program.cs
@@ -30,8 +30,8 @@ namespace domain_utility
|
|||||||
|
|
||||||
static readonly string[,] computerNameRegex = new string[,] {
|
static readonly string[,] computerNameRegex = new string[,] {
|
||||||
{ "^[a-zA-Z]+\\d+$", "R54-630300" }, // THE01
|
{ "^[a-zA-Z]+\\d+$", "R54-630300" }, // THE01
|
||||||
{ "^\\d+[a-zA-Z]+\\d+$", "R54-" }, // 630300THE01
|
{ "^\\d{6,}[a-zA-Z]+\\d+$", "R54-" }, // 630300THE01
|
||||||
{ "^[rR]\\d*[-]\\d+[a-zA-Z]+\\d+$", "" } // R54-630300THE01
|
{ "^[rR]\\d{2,}[-]\\d{6,}[a-zA-Z]+\\d+$", "" } // R54-630300THE01
|
||||||
};
|
};
|
||||||
|
|
||||||
private static string domain_user = string.Empty;
|
private static string domain_user = string.Empty;
|
||||||
@@ -75,7 +75,7 @@ namespace domain_utility
|
|||||||
Console.Write("> ");
|
Console.Write("> ");
|
||||||
string data = Console.ReadLine();
|
string data = Console.ReadLine();
|
||||||
if (string.IsNullOrWhiteSpace(data))
|
if (string.IsNullOrWhiteSpace(data))
|
||||||
InputData(message, callback, withClear, withChecks);
|
return InputData(message, callback, withClear, withChecks);
|
||||||
data = data.Trim();
|
data = data.Trim();
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
if (withChecks)
|
if (withChecks)
|
||||||
@@ -200,9 +200,9 @@ namespace domain_utility
|
|||||||
case IPStatus.Success:
|
case IPStatus.Success:
|
||||||
{
|
{
|
||||||
if (pingReply.RoundtripTime < 1)
|
if (pingReply.RoundtripTime < 1)
|
||||||
returnMessage = string.Format("Ответ от {0}: число байт={1} время<1ms TTL={2}", pingReply.Address, pingReply.Buffer.Length, pingReply.Options.Ttl);
|
returnMessage = string.Format("Ответ от {0}: число байт={1} время<1мс TTL={2}", pingReply.Address, pingReply.Buffer.Length, pingReply.Options.Ttl);
|
||||||
else
|
else
|
||||||
returnMessage = string.Format("Ответ от {0}: число байт={1} время={2}ms TTL={3}", pingReply.Address, pingReply.Buffer.Length, pingReply.RoundtripTime, pingReply.Options.Ttl);
|
returnMessage = string.Format("Ответ от {0}: число байт={1} время={2}мс TTL={3}", pingReply.Address, pingReply.Buffer.Length, pingReply.RoundtripTime, pingReply.Options.Ttl);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IPStatus.TimedOut:
|
case IPStatus.TimedOut:
|
||||||
@@ -237,6 +237,7 @@ namespace domain_utility
|
|||||||
string remote = InputData("\nВведите IP адрес или имя компьютера (пр. 10.234.16.129, 'IT04', '630300IT04', 'R54-630300IT04'):",
|
string remote = InputData("\nВведите IP адрес или имя компьютера (пр. 10.234.16.129, 'IT04', '630300IT04', 'R54-630300IT04'):",
|
||||||
StartPing);
|
StartPing);
|
||||||
|
|
||||||
|
Console.WriteLine("Нажмите Ctrl + C чтобы остановить\n");
|
||||||
string correctName = CheckComputerName(remote);
|
string correctName = CheckComputerName(remote);
|
||||||
if (correctName != string.Empty)
|
if (correctName != string.Empty)
|
||||||
{
|
{
|
||||||
@@ -244,7 +245,7 @@ namespace domain_utility
|
|||||||
{
|
{
|
||||||
IPAddress ip = Dns.GetHostEntry(correctName).AddressList.First(addr => addr.AddressFamily == AddressFamily.InterNetwork);
|
IPAddress ip = Dns.GetHostEntry(correctName).AddressList.First(addr => addr.AddressFamily == AddressFamily.InterNetwork);
|
||||||
remote = ip.ToString();
|
remote = ip.ToString();
|
||||||
Console.WriteLine("Обмен пакетами с {0} [{1}] с 32 байтами данных:", correctName, remote);
|
Console.WriteLine("Обмен пакетами с {0}.main.russianpost.ru [{1}] с 32 байтами данных:", correctName, remote);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user