MAIN要么是VOID,要么是INT,没有STRING
但是可以让MAIN函数带参数MAIN(STRING STR)
要输出字符串CONSOLE.WRITE(STR)

解决方案 »

  1.   

    首先我们要明确一下,你的console程序返回值得话,是谁的到这个返回值。
    如果你要返回一串字符串的话,对console来说没什么意义。你完全可以把它WriteLine到屏幕上或写到文件里面。Console return的作用在于告诉调用console程序的程序,这个console执行的成功与否。你可以用批处理来调用console,这是返回值可以最为上级调用的错误级别或者用户自定义的成功或失败。
    debut(debut)说得没错,console只能定义为 void或者 int,其他都不行。参见 Inside C#(C#技术内幕)英文:The Main Method,Return Values  in part ii,chaper 5, Classes,原文如下However, you can also define Main to return a value of type int. Although not common in GUI applications, this can be useful when you're writing console applications that are designed to be run in batch. The return statement terminates execution of the method and the returned value is used as an error level to the calling application or batch file to indicate user-defined success or failure. To do this, use the following prototype: public static int Main()
    {    // Return some value of type int
        // that represents success or value.
        return 0;
    }中文:p63,第一节