Pass a JSON string as a command line argument

后端 未结 6 1746
一个人的身影
一个人的身影 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:44

    Just send json value to commandline after catch value and replace it. It's work for me.

    args[1].Replace("{","{\"").Replace(":","\":\"").Replace(",","\",\"").Replace("}","\"}");
    

提交回复
热议问题