473,320 Members | 1,950 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,320 software developers and data experts.

newgie string help please


hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren
Nov 15 '05 #1
10 1520
Darren-

By escaping it;

string s = "can you find the \" extra quote?";

But, if you add a quote to you string in the place you indicated, you will
have unbalanced quotes. What you want is for you string to look like this;

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r

So you would assign the string like this:

string s = "\"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe\" /r";

HTH
Brian W

<darren> wrote in message news:cl********************************@4ax.com...

hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren

Nov 15 '05 #2
Hi that line gets me a unrecognized escape sequence error

string s = "\"C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\" /r";

regards
Darren
On Sat, 14 Feb 2004 14:06:42 +0000, darren <> wrote:

hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren


Nov 15 '05 #3
darren wrote:
Hi that line gets me a unrecognized escape sequence error


Read the docs on strings you really must. Try this:

string s = "\"C:\\Documents and Settings\\Darren\\My Documents\\Visual
Studio Projects\\shorcut\\bin\\Debug\\shorcut.exe\\" /r";

--
gabriel
Nov 15 '05 #4
hi this just gives more errors

On Sat, 14 Feb 2004 17:10:13 +0000, gabriel <no@no--spam.com> wrote:
darren wrote:
Hi that line gets me a unrecognized escape sequence error


Read the docs on strings you really must. Try this:

string s = "\"C:\\Documents and Settings\\Darren\\My Documents\\Visual
Studio Projects\\shorcut\\bin\\Debug\\shorcut.exe\\" /r";


Nov 15 '05 #5
try this

string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";

<darren> wrote in message news:cl********************************@4ax.com...

hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren

Nov 15 '05 #6
copy and paste error ... don't include the last \
string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";
string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe"" /r";
"Du Dang" <vi*******@hotmail.com> wrote in message
news:M4******************@nnrp1.uunet.ca... try this

string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";

<darren> wrote in message

news:cl********************************@4ax.com...

hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren


Nov 15 '05 #7
hi ok thank for the ideas so far here is my small test program if
anyone can help that would be great i just want to make a
desktopshortcut whic also passes \r

regards
Darren

On Sat, 14 Feb 2004 14:06:42 +0000, darren <> wrote:

hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren


Nov 15 '05 #8
hi ok thank for the ideas so far here is my small test program if
anyone can help that would be great i just want to make a
desktopshortcut whic also passes \r

regards
Darren
On Sat, 14 Feb 2004 14:06:42 +0000, darren <> wrote:

hi iam righting aprogram that creates its own desktop shotcut and a
want to add a command line switch

so i want to have a string like this

"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r"

my problem is how do i get the single " quote mark into my string
please help

thanks
Darren


Nov 15 '05 #9

hi ok thank for the ideas so far here is my small test program if
anyone can help that would be great i just want to make a
desktopshortcut whic also passes \r

regards
Darren

On Sat, 14 Feb 2004 12:43:49 -0500, "Du Dang" <vi*******@hotmail.com>
wrote:
copy and paste error ... don't include the last \
string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";


string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe"" /r";
"Du Dang" <vi*******@hotmail.com> wrote in message
news:M4******************@nnrp1.uunet.ca...
try this

string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";

<darren> wrote in message

news:cl********************************@4ax.com.. .
>
> hi iam righting aprogram that creates its own desktop shotcut and a
> want to add a command line switch
>
> so i want to have a string like this
>
> "C:\Documents and Settings\Darren\My Documents\Visual Studio
> Projects\shorcut\bin\Debug\shorcut.exe" /r"
>
> my problem is how do i get the single " quote mark into my string
> please help
>
> thanks
> Darren



Nov 15 '05 #10
NOTE: ur program need one argument to run, since u have
if (args.Length == 1) restriction in the main function
if you don't want to impose this restriction simply remove the if statement

regard to the program itself

u need to change the value of the textbox to
"C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe" /r
because this is the actual command for shortcut
and change the s variable to
string s = @"""C:\Documents and Settings\Darren\My Documents\Visual Studio
Projects\shorcut\bin\Debug\shorcut.exe""";
beause link.cs only need this to figure out what is the name for your
shortcut

Link.Update(Environment.SpecialFolder.DesktopDirec tory,textBox1.Text, s
,true);

hope this help
<darren> wrote in message news:th********************************@4ax.com...

hi ok thank for the ideas so far here is my small test program if
anyone can help that would be great i just want to make a
desktopshortcut whic also passes \r

regards
Darren

On Sat, 14 Feb 2004 12:43:49 -0500, "Du Dang" <vi*******@hotmail.com>
wrote:
copy and paste error ... don't include the last \
string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";


string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe"" /r";
"Du Dang" <vi*******@hotmail.com> wrote in message
news:M4******************@nnrp1.uunet.ca...
try this

string s = @"""C:\Documents and Settings\Darren\My Documents\Visual
Studio Projects\shorcut\bin\Debug\shorcut.exe\"" /r";

<darren> wrote in message

news:cl********************************@4ax.com.. .
>
> hi iam righting aprogram that creates its own desktop shotcut and a
> want to add a command line switch
>
> so i want to have a string like this
>
> "C:\Documents and Settings\Darren\My Documents\Visual Studio
> Projects\shorcut\bin\Debug\shorcut.exe" /r"
>
> my problem is how do i get the single " quote mark into my string
> please help
>
> thanks
> Darren

Nov 15 '05 #11

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

Similar topics

3
by: Jesse | last post by:
I have a string with the following information. $myString = "This is my example string please. Please visit http://www.mylink.com . More example text goes here. another link http://www.link2.com...
9
by: Derek Hart | last post by:
I wish to execute code from a string. The string will have a function name, which will return a string: Dim a as string a = "MyFunctionName(param1, param2)" I have seen a ton of people...
7
by: Ahmad A. Rahman | last post by:
Hi All, I have a string as and I want to split the string, which will turn into an array of: Arr = "1"; Arr = "two"; Arr = "three"; Arr = "fo""ur"; Arr = "fi,ve";
2
by: I am Sam | last post by:
Ok I set up a button column to delete an individual record. Nothing happens when I test it. Someone please help understand why. Below is the associated coding: DataGrid control: ...
1
by: A Hirsi | last post by:
I have created a vb .net program as a service that is using a simple ftpclient to connect to a remote server and check the status of a file for subsequent downloading if there have been changes to...
0
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
0
by: Jai | last post by:
Hi, Somebody please tell me how to bind(two way) a checkboxlist with objectdatasource if the checkboxlist is inside a formview..... Code of FormView is like this::--- <asp:FormView...
22
by: Amali | last post by:
I'm newdie in c programming. this is my first project in programming. I have to write a program for a airline reservation. this is what i have done yet. but when it runs it shows the number of...
14
by: donovans | last post by:
Hey there, First question: I really need help with debugging this code. I keep getting the java.sql.SQLException: General error, and am now lost at a solution to it...I get this with about 4 of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.