\"run as\" => \"Java application\" and it will run the current Main Method." />
开发者

What is the equivalent Main method for Java in c#

in Java, you can write:

public stati开发者_运维知识库c void Main(String[] args) { }

and than "right click" => "run as" => "Java application" and it will run the current Main Method.

Any chance to have that in Visual Web Developer?

Thanks


Visual Web Developer is presumably for web applications. Web applications don't run in that sort of way - they respond to web requests.

The equivalent of a main method (note case) in Java is a Main method in C#, in one of the following forms:

static void Main(string[] args)
static void Main()
static int Main(string[] args)
static int Main()

The method can have any accessibility, can return int or void, and either be parameterless or take an array of strings.

That will work fine when creating a console or Windows application - but not a web application. If you want to write desktop applications, use Visual C# Express or something similar.


No there isn't. Architecture of web-app is somewhat different then desktop or standalone applications.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜