Hi,
Newbie here. Here's my code for a c# console app:
public static int Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Please enter a database name.");
return 1;
}
Console.WriteLine (@args[0]);
Find t = new Find();
t.DatabaseName = @args[0];
t.Search();
return 0;
}
If I use "master" has a parameter, what gets printed to the commandline is
master. I want to print "master". Why are the double-quotes getting lost? I
also want to set the t object's DatabaseName property to include the
double-quotes, but it's losing them too.
What am I missing? Thanks. 5 4375
Mark,
The command shell strips the quotes, as they are used to indicate
parameters that have spaces in them. You might want to try using quotes in
the quotes, like this (I'm not sure if this will work):
""master""
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"mark" <ma**@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com... Hi,
Newbie here. Here's my code for a c# console app:
public static int Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please enter a database name."); return 1; } Console.WriteLine (@args[0]); Find t = new Find(); t.DatabaseName = @args[0]; t.Search(); return 0; }
If I use "master" has a parameter, what gets printed to the commandline is master. I want to print "master". Why are the double-quotes getting lost? I also want to set the t object's DatabaseName property to include the double-quotes, but it's losing them too.
What am I missing? Thanks.
hi,
You could try using "\"Master\"". I have used this before just check if it
works for you.
Tarakeshwar
"mark" <ma**@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com... Hi,
Newbie here. Here's my code for a c# console app:
public static int Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please enter a database name."); return 1; } Console.WriteLine (@args[0]); Find t = new Find(); t.DatabaseName = @args[0]; t.Search(); return 0; }
If I use "master" has a parameter, what gets printed to the commandline is master. I want to print "master". Why are the double-quotes getting lost?
I also want to set the t object's DatabaseName property to include the double-quotes, but it's losing them too.
What am I missing? Thanks.
Hi mark:
You can escape the double quotes with a backslash to prevent the
command shell from interpreting them before executing your program.
\"master\"
--
Scott http://www.OdeToCode.com
On Thu, 16 Sep 2004 07:45:02 -0700, "mark"
<ma**@discussions.microsoft.com> wrote: Hi,
Newbie here. Here's my code for a c# console app:
public static int Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please enter a database name."); return 1; } Console.WriteLine (@args[0]); Find t = new Find(); t.DatabaseName = @args[0]; t.Search(); return 0; }
If I use "master" has a parameter, what gets printed to the commandline is master. I want to print "master". Why are the double-quotes getting lost? I also want to set the t object's DatabaseName property to include the double-quotes, but it's losing them too.
What am I missing? Thanks.
Yes; you may escape the quote by prefixing it with backslash, like:
"\"master\""
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"mark" <ma**@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com... Thanks for the reply. ""master"" doesn't work either, the output is
master. Any other ideas?
"Nicholas Paldino [.NET/C# MVP]" wrote:
Mark,
The command shell strips the quotes, as they are used to indicate parameters that have spaces in them. You might want to try using quotes
in the quotes, like this (I'm not sure if this will work):
""master""
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"mark" <ma**@discussions.microsoft.com> wrote in message news:F4**********************************@microsof t.com... Hi,
Newbie here. Here's my code for a c# console app:
public static int Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please enter a database name."); return 1; } Console.WriteLine (@args[0]); Find t = new Find(); t.DatabaseName = @args[0]; t.Search(); return 0; }
If I use "master" has a parameter, what gets printed to the
commandline is master. I want to print "master". Why are the double-quotes getting
lost? I also want to set the t object's DatabaseName property to include the double-quotes, but it's losing them too.
What am I missing? Thanks.
Thanks for the reply. ""master"" doesn't work either, the output is master.
Any other ideas?
"Nicholas Paldino [.NET/C# MVP]" wrote: Mark,
The command shell strips the quotes, as they are used to indicate parameters that have spaces in them. You might want to try using quotes in the quotes, like this (I'm not sure if this will work):
""master""
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"mark" <ma**@discussions.microsoft.com> wrote in message news:F4**********************************@microsof t.com... Hi,
Newbie here. Here's my code for a c# console app:
public static int Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Please enter a database name."); return 1; } Console.WriteLine (@args[0]); Find t = new Find(); t.DatabaseName = @args[0]; t.Search(); return 0; }
If I use "master" has a parameter, what gets printed to the commandline is master. I want to print "master". Why are the double-quotes getting lost? I also want to set the t object's DatabaseName property to include the double-quotes, but it's losing them too.
What am I missing? Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: deko |
last post by:
I'm trying to log error messages and sometimes (no telling when or where)
the message contains a string with double quotes. Is there a way get the
query to insert the string with the double...
|
by: (PeteCresswell) |
last post by:
Is his just a flat-out "No-No" or is there some workaround when it comes time
for SQL searches and DAO.FindFirsts against fields containing same?
I can see maybe wrapping the value searched for...
|
by: gar |
last post by:
Hi,
I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code
text= Replace(text, """", "'"
This works fine (for normal double quotes).The problem...
|
by: j101 |
last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but
there seems to be a general problem loading a specify MQ shared library
"/opt/mqm/lib/libmqm_r.so". I have MQ v6...
|
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,...
| |
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |