mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
修复ls问题(但没有成功)
This commit is contained in:
@@ -28,7 +28,14 @@ namespace CMLeonOS
|
|||||||
|
|
||||||
public string CurrentDirectory
|
public string CurrentDirectory
|
||||||
{
|
{
|
||||||
get { return currentDirectory; }
|
get
|
||||||
|
{
|
||||||
|
if (currentDirectory == @"0:\")
|
||||||
|
{
|
||||||
|
return ".";
|
||||||
|
}
|
||||||
|
return currentDirectory;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeDirectory(string path)
|
public void ChangeDirectory(string path)
|
||||||
@@ -89,7 +96,8 @@ namespace CMLeonOS
|
|||||||
if (Directory.Exists(fullPath))
|
if (Directory.Exists(fullPath))
|
||||||
{
|
{
|
||||||
// 列出当前目录下的文件和子目录
|
// 列出当前目录下的文件和子目录
|
||||||
Console.WriteLine($"Contents of {path}:");
|
string displayPath = path == "." ? CurrentDirectory : path;
|
||||||
|
Console.WriteLine($"Contents of {displayPath}:");
|
||||||
|
|
||||||
// 列出子目录
|
// 列出子目录
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user