End Google Ads 201810 - BS.net 01 --> Hello,

I'm attempting to have a console program take a path as an argument.

I have the following code executing:


static void Main(string[] args)
{
HandleArgs(args);
}

public static void HandleArgs(string[] args)
{
foreach (string arg in args)
{
if (arg.Contains("/path:"))
{
string execpath = arg.Substring(6, arg.Length - 6);
}
}
}

What i'd like to do is to take the string[] args as it is passed to Main() as a verbatim string.

The problem arises when the argument /path: is input as /path:"c:\documents and settings\". The string arg in args is not verbatim, and execpath is then c:\documents and settings\" not c:\documents and settings\ as desired.

Another foreseeable situation is the the /path: argument is /path:""c:\documents and settings\", as I am attempting a condition to determine if the last character is a \


How can I take the string into string[] args passed to Main() as a a verbatim string.


Thanks,

Matt