Console app arguments, how arguments are passed to Main method

前端 未结 10 1201
醉话见心
醉话见心 2020-12-08 09:30

This would be question from c# beginner. When I create console application I get Main method with parameter args as array string. I do not understand how t

10条回答
  •  一个人的身影
    2020-12-08 10:21

    The Main method is the Entry point of your application. If you checkout via ildasm then

    .method private hidebysig static void  Main(string[] args) cil managed
    {
      .entrypoint
    

    This is what helps in calling the method

    The arguments are passed as say C:\AppName arg1 arg2 arg3

提交回复
热议问题