向main方法传递参数

 

 

右键点击项目,点击“属性”:

看图,红框中位置,多个参数用空格分开。

 

代码中使用参数:

static void Main(string[] args){
    string url = args[0];
    string targetFileName = args[1];
}

 

第2种方法:

直接在cmd里命令行里调用:xxx.exe + 空格 +参数值

向main方法传递参数

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-01-25
  • 2022-02-10
  • 2021-10-07
  • 2021-09-11
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2021-08-22
  • 2021-06-18
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案