问题描述
我正在尝试在cosmos OS中添加文件系统。启动操作系统时,出现以下错误:
这是我所有的源代码:
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;
using Cosmos.System.Graphics;
using System.Drawing;
using System.Xml.Linq;
namespace OperatingSystem
{
public class Kernel : Sys.Kernel
{
Sys.FileSystem.CosmosVFS fs;
// string current_directory = "0:\\";
public void Save(string save)
{
string fullPath = @"0:\write.txt\";
Console.WriteLine(save);
using (StreamWriter writer = new StreamWriter(fullPath))
{
writer.WriteLine(save);
}
string readText = File.ReadAllText(fullPath);
Console.WriteLine(readText);
}
public void check(string text)
{
Console.Write("Is that all you want to write [Y/N] ");
switch(Console.ReadLine())
{
case "Y":
Save(text);
break;
case "y":
Save(text);
break;
case "N":
Run();
break;
case "n":
Run();
break;
}
}
protected override void BeforeRun()
{
Console.WriteLine("Welcome to Print OS!");
fs = new Sys.FileSystem.CosmosVFS();
Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);
}
protected override void Run()
{
Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Print OS Version 1.0");
Console.BackgroundColor = ConsoleColor.Black;
Console.Write("#> ");
var input = Console.ReadLine();
check(input);
}
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)