【问题标题】:how can I start up an object in Visual Studio如何在 Visual Studio 中启动对象
【发布时间】:2010-11-30 20:21:37
【问题描述】:

.exe 不包含适合入口点的静态“Main”方法。

为此,我转到应用程序选项卡上的项目属性,然后启动对象,但它显示它没有设置,我无法像 frmMain 那样进入我的程序。

如何在启动对象上输入我的程序?

【问题讨论】:

  • 我认为你需要一个主要方法
  • HAOLADER,您的大写锁定键位于您的 A 键左侧大约 1/3 英寸处。

标签: c# visual-studio


【解决方案1】:

创建一个新的源代码文件(可能将其命名为“Program.cs”)。在该文件中,插入如下内容:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyApplication
{
     class Program
     {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.WriteLine("* Press Any Key to Exit *");
            Console.ReadKey();
        }
     }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-10
    • 2019-03-31
    • 1970-01-01
    • 1970-01-01
    • 2022-11-02
    • 1970-01-01
    • 2023-01-31
    • 2020-11-08
    相关资源
    最近更新 更多