Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从单独的类打开/运行类?_C#_Class - Fatal编程技术网

C# 如何从单独的类打开/运行类?

C# 如何从单独的类打开/运行类?,c#,class,C#,Class,我正在用Xamarin Studio上的C#制作一个简单的DOS操作系统。问题是,我已经在Visual Studio中制作了几个程序来做我在Xamarin上做不到的事情 尽我所能解释我的困难:我有一个名为OSBootup.cs的类,我想运行这个类,然后它在我的项目中启动另一个类。有办法吗?如果没有,我还能用什么方法 我的代码:(OSBootup.cs) 万一您需要查看我的另一个文件(dosconnel.cs): 您有dosconnel DConsole=newdosconnel(),但缺少DCo

我正在用Xamarin Studio上的C#制作一个简单的DOS操作系统。问题是,我已经在Visual Studio中制作了几个程序来做我在Xamarin上做不到的事情

尽我所能解释我的困难:我有一个名为
OSBootup.cs
的类,我想运行这个类,然后它在我的项目中启动另一个类。有办法吗?如果没有,我还能用什么方法

我的代码:(OSBootup.cs)

万一您需要查看我的另一个文件(dosconnel.cs):


您有
dosconnel DConsole=newdosconnel(),但缺少
DConsole.Start()


(回答是:mbeckish)

您拥有
dosconnel DConsole=newdosconnel(),但您缺少
DConsole.Start()
@mbeckish可能就是这样,我的Xamarin没有显示我有时可以执行的所有功能。里面满是虫子。谢谢。我喜欢那个时候,当我发布这篇文章时,我想知道是否没有办法开设一个单独的课程。x'D
using System;
using System.IO;
using System.Threading;

namespace OperatingSystemCore
{
    public static class OSBootup
    {
        public static void Main (String[] args)
        {
            bool isStarting;

            Start:

            isStarting = true;

            Console.Write ("Starting SyteraOS ");

            Thread.Sleep (1000);
            Console.Write (". ");

            Thread.Sleep (1000);
            Console.Write (". ");

            Thread.Sleep (1000);
            Console.Write (". ");

            Thread.Sleep (1000);
            Console.Clear ();
            Console.Write ("Starting SyteraOS ");

            Thread.Sleep (1000);
            Console.Write (". ");

            Thread.Sleep (1000);
            Console.Write (". ");

            Thread.Sleep (1000);
            Console.Write (". ");

            Thread.Sleep (4500);
            Console.Clear ();

            Console.WriteLine ("Press Any Key To Start SyteraOS ...");
            Console.ReadKey ();

            End:

            DOSConsole DConsole = new DOSConsole ();

            isStarting = false;
        }
    }
}
using System;

namespace OperatingSystemCore
{
    public class DOSConsole
    {
        public void Start ()
        {
            Console.WriteLine ("Give us a name.");
            Console.WriteLine ("");
            Console.Write ("Name: ");
            string Name = Console.ReadLine ();

            Console.Clear ();
            Console.Write ("User->" + Name);
        }

        public void Update ()
        {

        }

        public void Commands ()
        {

        }
    }
}