Обновить Program.cs
This commit is contained in:
+5
-5
@@ -11,7 +11,7 @@ class View_driver
|
|||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
List<Drivers> drivers = new List<Drivers>();
|
List<Drivers> drivers = new List<Drivers>();
|
||||||
string unknownName = "Неизвестное устройство";
|
string unknownName = "Unknown Device";
|
||||||
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity");
|
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity");
|
||||||
foreach (ManagementObject obj in searcher.Get())
|
foreach (ManagementObject obj in searcher.Get())
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ class View_driver
|
|||||||
var statusColor = driver.Status_Device_driver switch
|
var statusColor = driver.Status_Device_driver switch
|
||||||
{
|
{
|
||||||
"OK" => ConsoleColor.Green,
|
"OK" => ConsoleColor.Green,
|
||||||
"Error" => ConsoleColor.Red,
|
"Error" => ConsoleColor.DarkRed,
|
||||||
"Degraded" => ConsoleColor.Yellow,
|
"Degraded" => ConsoleColor.Yellow,
|
||||||
_ => ConsoleColor.Gray
|
_ => ConsoleColor.Gray
|
||||||
};
|
};
|
||||||
@@ -33,17 +33,17 @@ class View_driver
|
|||||||
? ConsoleColor.Red
|
? ConsoleColor.Red
|
||||||
: ConsoleColor.DarkGray;
|
: ConsoleColor.DarkGray;
|
||||||
|
|
||||||
Console.Write("Имя: ");
|
Console.Write("Name: ");
|
||||||
Console.ForegroundColor = nameColor;
|
Console.ForegroundColor = nameColor;
|
||||||
Console.Write(driver.Name_Device_driver);
|
Console.Write(driver.Name_Device_driver);
|
||||||
|
|
||||||
Console.ResetColor();
|
Console.ResetColor();
|
||||||
Console.Write(" | Статус: ");
|
Console.Write(" | Status: ");
|
||||||
Console.ForegroundColor = statusColor;
|
Console.ForegroundColor = statusColor;
|
||||||
Console.Write(driver.Status_Device_driver);
|
Console.Write(driver.Status_Device_driver);
|
||||||
|
|
||||||
Console.ResetColor();
|
Console.ResetColor();
|
||||||
Console.Write(" | Путь: ");
|
Console.Write(" | Path: ");
|
||||||
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||||
Console.Write($"{driver.Path_Device_driver}\n");
|
Console.Write($"{driver.Path_Device_driver}\n");
|
||||||
Console.ResetColor();
|
Console.ResetColor();
|
||||||
|
|||||||
Reference in New Issue
Block a user