c#编译器选项如何使用?

蜗牛驰 2016-04-18 09:58:17
在多个main的情况下要指定启动某个main函数,通过命令的方式为/main,这个“/main”要在哪里输入啊?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace main的使用
{
class Program
{
static void Main(string[] args)
{
MathExample.Main();
return;
}
}
class MathExample
{
static int Add(int x ,int y)
{
return x + y;
}
public static int Main()
{
int i = Add(5, 10);
Console.WriteLine(i);
return 0;
}
}
}


假如要启动MathExample的主函数,这个时候在哪里输入 csc Program.cs /main:main的使用.MathExample
...全文
106 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Poopaye 2016-04-19
  • 打赏
  • 举报
回复
引用 2 楼 qq_30332915 的回复:
有的,然后呢
然后cd到你Program.cs所在的目录,输csc Program.cs /main:main
蜗牛驰 2016-04-19
  • 打赏
  • 举报
回复
有的,然后呢
Poopaye 2016-04-18
  • 打赏
  • 举报
回复
开始菜单里,一般有一个本机工具命令提示,或者Visual Studio Tools

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧