Command line parameter question



Hi

Is it possible, in C#, to retrieve the entire literal string passed to
a console application as a command line?

I'm aware of the String array on Main, but this parses the string to
remove quotes, break arguments on spaces, etc. For legacy reasons, I
have to produce an application which accepts command line arguments
with a syntax which doesn't fit within this model.

I'm also aware of the Microsoft.VisualBasic.Interaction.Command()
function, which works and which I can use, but what I'd like to know
is, is there a more elegant approach?

Thanks

.



Relevant Pages

  • Re: How do you inherit DOS console in Win32 application?
    ... > console in a Win32 assembly console application? ... ByVal lpFile As String, ByVal lpParameters As String, _ ... If your app is calling the command prompt, ... Dim hWnd As Long, iDummy As Long, sCmd As String ...
    (alt.lang.asm)
  • TIP #185: Null Handling
    ... nulls, and command modifications for manipulating them. ... Tcl deals with strings, the universal medium for representing data. ... is know and it is an empty string, but if a respondent forgets to give ...
    (comp.lang.tcl)
  • Re: Determine how Word was launched
    ... inspect the command line used to launch Word. ... Private Declare Function GetCommandLineA Lib "kernel32" As Long ... Public Function GetCommandLineAs String ... Dim lngCmdLinePtr As Long ...
    (microsoft.public.office.developer.vba)
  • Re: Class.getMethod in classs static initializer block
    ... I just wanted to add that I had some similar code for a "command line server" project. ... static private final boolean DEBUG = true; ... {public ReturnCode runCommand(String s) ... public ReturnCode parseLine(String line) ...
    (comp.lang.java.programmer)
  • Re: String from char[] with null termination.
    ... > When I run it from the command line, ... but not how different results can come from the same compiler. ... When you test the code from the command line, the console ... console view handles it by considering it the end of the string and not ...
    (comp.lang.java.programmer)

Loading