I need to use quotes within quotes for a command line argument for it to execute properly. I have tried exiting quotes with another set of quotes. """ I have also tried to exit quotes with \"". This just asks for expected end of line ; and won't compile. I also tried using literals @" and had no luck getting it to work as well.
Code:
process22.StartInfo.Arguments = "/C advfirewall firewall set rule name="blocknet" new enable="no"";
Can anyone word this where it will compile? I searched for answer, but none that I found have worked in this circumstance. I considered combining strings, but I am still learning to code so I want to know the normal solution. It's the last piece of code in my program that I need working before my program is ready to go.
Code:
process22.StartInfo.Arguments = @"/C advfirewall firewall set rule name=""blocknet"" new enable=""yes""";
This code compiles but does not accept arguments.