mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
拆分代码4
This commit is contained in:
32
shell/Commands/FileSystem/DiskInfoCommand.cs
Normal file
32
shell/Commands/FileSystem/DiskInfoCommand.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Sys = Cosmos.System;
|
||||
|
||||
namespace CMLeonOS.Commands.FileSystem
|
||||
{
|
||||
public static class DiskInfoCommand
|
||||
{
|
||||
public static void GetDiskInfo(Action<string> showError)
|
||||
{
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine(" Disk Information");
|
||||
Console.WriteLine("====================================");
|
||||
|
||||
try
|
||||
{
|
||||
var disks = Sys.FileSystem.VFS.VFSManager.GetDisks();
|
||||
|
||||
if (disks == null || disks.Count == 0)
|
||||
{
|
||||
Console.WriteLine("No disks found.");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"Total Disks: {disks.Count}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error getting disk info: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user