Most applications expect the arguments in quotes, though you could
concatenate them back into a single string (including spaces).
static void Main(string[] args)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < args.Length; i++)
{
sb.Append(args[i]);
if (i < args.Length - 1)
{
sb.Append(" ");
}
}
Console.Out.WriteLine(sb.ToString());
}
"gopal" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> static void Main(string[] args)
> {
> ....
> ....
> }
>
>
> I have an EXE now. I am now giving one of the arguments
>
> as
>
>> EXE C:\Documents and Settings\121308\Desktop\First.xml.
>
> The problem is i am not able to parse the XML file. I am getting the
> message at command line as
>
> 'C:\Documents' is not recognized as an internal or external command,
> operable program or batch file.
>
> How can read a file from a folder which has spaces in the folder name
> itself like the one
> mentioned above as Documents and settings.
>
> Should user give the arguments with in Quotes/ or is there any other
> smart way
>
>
> Thanks
> JP
>
|