Possible Duplicate:
i cant change static void Main(string[] args)
Hi, when I change static void Main(string[] args) to this code the error I get is
Program 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\P开发者_C百科rojects\Project1\FtpFiles\FtpFiles\obj\Debug\FtpFiles.exe' does not contain a static 'Main' method suitable for an entry point Can anyone please help me?
You cannot change the "static void Main(string[] args)" name or argument, it is the entry point for the program.
If you don't want the args[] parameter, just ignore it.
You need a static void Main
method in every program, this is called an entry point, meaning this is what the runtime looks for when trying to execute your program. If there is none, it fails, as you saw with your example.
check this post : Entry Point in C# program
static void Main(string[] args) -
is palce from where you code get started executing.
if its not found it will give an error to you.
if you dont want to use if than create >> class Library project rather than console application.
精彩评论