473,698 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:\Documen ts and Settings\Darren \My Documents\Visua l Studio
Projects\shorcu t\bin\Debug\sho rcut.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 1548
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:\Documen ts and Settings\Darren \My Documents\Visua l Studio
Projects\shorcu t\bin\Debug\sho rcut.exe" /r

So you would assign the string like this:

string s = "\"C:\Docum ents and Settings\Darren \My Documents\Visua l Studio
Projects\shorcu t\bin\Debug\sho rcut.exe\" /r";

HTH
Brian W

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

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:\Documen ts and Settings\Darren \My Documents\Visua l Studio
Projects\shorcu t\bin\Debug\sho rcut.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:\Docum ents and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.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:\Document s and Settings\Darren \My Documents\Visua l Studio
Projects\shorc ut\bin\Debug\sh orcut.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:\\Document s and Settings\\Darre n\\My Documents\\Visu al
Studio Projects\\shorc ut\\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:\\Document s and Settings\\Darre n\\My Documents\\Visu al
Studio Projects\\shorc ut\\bin\\Debug\ \shorcut.exe\\" /r";


Nov 15 '05 #5
try this

string s = @"""C:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.exe\"" /r";

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

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:\Documen ts and Settings\Darren \My Documents\Visua l Studio
Projects\shorcu t\bin\Debug\sho rcut.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:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.exe\"" /r";
string s = @"""C:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.exe"" /r";
"Du Dang" <vi*******@hotm ail.com> wrote in message
news:M4******** **********@nnrp 1.uunet.ca... try this

string s = @"""C:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.exe\"" /r";

<darren> wrote in message

news:cl******** *************** *********@4ax.c om...

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:\Documen ts and Settings\Darren \My Documents\Visua l Studio
Projects\shorcu t\bin\Debug\sho rcut.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:\Document s and Settings\Darren \My Documents\Visua l Studio
Projects\shorc ut\bin\Debug\sh orcut.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:\Document s and Settings\Darren \My Documents\Visua l Studio
Projects\shorc ut\bin\Debug\sh orcut.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*******@hotm ail.com>
wrote:
copy and paste error ... don't include the last \
string s = @"""C:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.exe\"" /r";


string s = @"""C:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.exe"" /r";
"Du Dang" <vi*******@hotm ail.com> wrote in message
news:M4******* ***********@nnr p1.uunet.ca...
try this

string s = @"""C:\Document s and Settings\Darren \My Documents\Visua l
Studio Projects\shorcu t\bin\Debug\sho rcut.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:\Documen ts and Settings\Darren \My Documents\Visua l Studio
> Projects\shorcu t\bin\Debug\sho rcut.exe" /r"
>
> my problem is how do i get the single " quote mark into my string
> please help
>
> thanks
> Darren



Nov 15 '05 #10

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

Similar topics

3
2306
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 . more text.. blah.."; What I'm wanting is a function to return the following string : $myString = This is my example string please. Please visit <a href'http://www.mylink.com'>link</a> . More example text goes here.
9
3693
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 discuss how reflection does this, but I cannot find the syntax to do this. I have tried several code example off of gotdotnet and other articles. Can somebody please show me the code to do this?
7
9581
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
1157
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: <asp:datagrid id="clubdg" DataKeyField="UserID" runat="server" GridLines="Vertical" CellPadding="2" BorderWidth="1px" BorderColor="#CCCCFF" CssClass="txt" AutoGenerateColumns="False" OnCancelCommand="Cancel_Click"
1
1712
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 it. I have been having many problems and need your help. 1. When I use a thread to start the service it only runs once and quits. I do not see any of my eventlog.writelog entries again. 2. I used a timer that fires off every 10 seconds (for...
0
2287
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 Setup Project and installed My Web Application on my Localhost and it works perfectly. When I install My Web Application on our “Production Server” it just doesn’t update the records on Edit mode!!!
0
2415
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 ID="FormView1" runat="server" DataSourceID="ObjectDataSource1"> <EditItemTemplate>
22
3259
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 seats as 0 and the flight no. is also repeating. If any can tell why is this please help me. #include<stdio.h> #include<ctype.h> #include<conio.h>
14
1784
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 my classes and the other 5 classes work fine. Any ideas? Money.java package surveying_reports; import javax.swing.*;
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8901
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.