What class parses to get Main()'s args?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

For some test code I am writing, I want to convert a string of characters
that I would theoretically enter on the command line into the string array
that is passed to my program's Main() method.

For example, on the command line I may have:
c:>program.exe "This is a test"

Whatever calls Main() will call using an array with a single string rather
than four strings, because of the 3 spaces. Anyway, what is the parser
class/method that converts "This is a test" to the appropriate string args
array? I am looking to call Main() from a test class and to parse the
string entered on the virtual command line just as it is parsed into a string
array when executed from the command line.

Thanks,
Stuart
 
Stuart,
Anyway, what is the parser
class/method that converts "This is a test" to the appropriate string args
array?

There's no managed class that does that. It's done in the CLR startup
code (I haven't looked exactly how they do it, but they may be using
the CommandLineToArgvW API).



Mattias
 
Back
Top