473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

command line arguments strange behaviour

Hi, i wonder if someone can explain the following...
Create new Console application...
static void Main(string[] args)
{
Console.WriteLine(args[0]);
}

Run it with the following param

ConsoleApplication1.exe test$^
On my Win XP and NET 1.1 i receive the output: test$
^ disappears.

Faced it first when worked with custom installer, then tried the simple
program also parsing command line...
Is ^ char used in splits?
ConsoleApplication1.exe test^^^^
produces the following output : test^^

Thank you.
Nov 22 '05 #1
3 1269
Oleg,
Is ^ char used in splits?


No it's an escape character (sort of like \ in C# string literals).
You can use it to escape otherwise special characters such as < and >.

ConsoleApplication1.exe test$^>

should print

test$>

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 22 '05 #2
Mattias - thank you for the explanation....

All below are just thoughts.....

As i already wrote, i faced this problem writing setup for the project....
But in real, the situation was like that -

Imagine, you add user dialog (TextBoxes A) to your setup project.
Fields are used for DB Setup in your custom installer.....

On installing user reports that DB login constantly fails.....
I become very nervous because it was tested many times......

As appears, InstallContext.ParseCommandLine (where custom installer take the
dialog field values from) also skips the literals )))
So if user provides password "test^ " he is not able to login than .....

As a sloution i wrote my own custom dialog called from the installer, but it
this i think the situation is quite silly )))
1. I can not use regular features provided by Setup Projects.
2. I can not explain the customer that he can not use ^ character in his
passwords..... )))

__________________________________________________ ________________

Sincerely yours,
Oleg Medyanik


Nov 22 '05 #3
Mattias - thank you for the explanation....

All below are just thoughts.....

As i already wrote, i faced this problem writing setup for the project....
But in real, the situation was like that -

Imagine, you add user dialog (TextBoxes A) to your setup project.
Fields are used for DB Setup in your custom installer.....

On installing user reports that DB login constantly fails.....
I become very nervous because it was tested many times......

As appears, InstallContext.ParseCommandLine (where custom installer take the
dialog field values from) also skips the literals )))
So if user provides password "test^ " he is not able to login than .....

As a sloution i wrote my own custom dialog called from the installer, but it
this i think the situation is quite silly )))
1. I can not use regular features provided by Setup Projects.
2. I can not explain the customer that he can not use ^ character in his
passwords..... )))

__________________________________________________ ________________

Sincerely yours,
Oleg Medyanik


Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: hue | last post by:
I am trying to parse command line options using getopt module. I have written the following Code import string import getopt def usage(): print '''haarp_make.py -- uses getopt to...
2
by: Oleg Medyanik | last post by:
Hi, i wonder if someone can explain the following... Create new Console application... static void Main(string args) { Console.WriteLine(args); } Run it with the following param ...
6
by: Edd Dawson | last post by:
Hi. I have a strange problem involving the passing of command line arguments to a C program I'm writing. I tried posting this in comp.programming yesterday but someone kindly suggested that I'd...
4
by: Roland | last post by:
Hi, I am developing a C++ project and want to pass some command line arguments in VS .NET 2003. I am in debug mode, the configuration is set to Debug and I entered my argument list in Project ->...
40
by: raphfrk | last post by:
I have a program which reads in 3 filenames from the command line prog filename1 filename2 filename3 However, it doesn't work when one of the filenames has spaces in it (due to a directory...
6
by: 31337one | last post by:
Hello all, I was wondering if there is a C/C++ command line parser that works for linux AND windows. . Anyways, the ideal parser im looking for should be able to support multiple arguments...
8
by: matthewperpick | last post by:
Check out this toy example that demonstrates some "strange" behaviour with keyword arguments and inheritance. ================================= class Parent: def __init__(self, ary = ):...
17
by: Matt | last post by:
Hello. I'm having a very strange problem that I would like ot check with you guys. Basically whenever I insert the following line into my programme to output the arguments being passed to the...
20
by: Casey | last post by:
Is there an easy way to use getopt and still allow negative numbers as args? I can easily write a workaround (pre-process the tail end of the arguments, stripping off any non-options including...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.