B
BBVan
I'm passing quoted path parameters to a VB .NET program and using the following declarations to retrieve them:
Dim szCommandLine As String = Environment.CommandLine
Dim szArgs() As String = Environment.GetCommandLineArgs()
When I look at the entire command line , the arguments are quoted. i.e.
szCommandLine equals "C:\test\FileSearch.exe" "E:\"
When I use GetCommandLineArgs to split the arguments into a string array, the quotes are removed and the trailing back slash removed and I getting the following results:
szArgs(0) equals C:\test\FileSearch.exe
szArgs(1) equals E:"
I'm running Windows XP Professional and using Visual Studio .NET 2003.
The documentation states that GetCommandLineArgs returns
An array of string where each element contains a command line argument. The first element is the executable file name, and the following zero or more elements contain the remaining command line arguments.
I've gotten around this by parsing the entire command line myself but I'd like to know if this is a problem or am I misunderstanding the documentation?
Thanks
Brant
Dim szCommandLine As String = Environment.CommandLine
Dim szArgs() As String = Environment.GetCommandLineArgs()
When I look at the entire command line , the arguments are quoted. i.e.
szCommandLine equals "C:\test\FileSearch.exe" "E:\"
When I use GetCommandLineArgs to split the arguments into a string array, the quotes are removed and the trailing back slash removed and I getting the following results:
szArgs(0) equals C:\test\FileSearch.exe
szArgs(1) equals E:"
I'm running Windows XP Professional and using Visual Studio .NET 2003.
The documentation states that GetCommandLineArgs returns
An array of string where each element contains a command line argument. The first element is the executable file name, and the following zero or more elements contain the remaining command line arguments.
I've gotten around this by parsing the entire command line myself but I'd like to know if this is a problem or am I misunderstanding the documentation?
Thanks
Brant