472,982 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 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 1511
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.