Pass a JSON string as a command line argument

后端 未结 6 1757
一个人的身影
一个人的身影 2021-01-04 18:19

I am trying to pass a json string to a C#-Program using Commandline.

The JSON-String looks like this:

{
    \"config\": {
        \"script\": {
             


        
6条回答
  •  感动是毒
    2021-01-04 18:57

    Declare it as a string with "" and escape the other " with \ and it should work.

    Command line:

    "{\"config\":{\"script\":{\"script_name\":\"test\",\"dir\":\"D:\\test\",\"destination\":\"M:\\neu\\test\",\"params\":\"/b /s /r:3 /w:5\"}}}"
    

提交回复
热议问题