PostHelpHelp with code. Using quotes within quotes.

Posts 1–2 of 2 · Page 1 of 1
Help with code. Using quotes within quotes.
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.
\"

These are called escape sequences. Characters that have no visible images or have special meaning in C++

Here's a few more
Code:
newline				\n		horizontal tab		\t		alert (bell)		\a
verticle tab		\v		backspace			\b		double quote		\"
backslash			\\		question mark		\?		single quote		\'
carriage return		\r		formfeed			\f
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?