Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 13th, 2006, 06:47 PM
Authorized User
 
Join Date: Apr 2006
Location: , , Canada.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Replacing characters in a string

Hello. Ok, what I am doing is using an "OpenFileDialogBox" to allow the user to select the location of Internet Explorer on their computer (in case it isn't in the default Program Files\Internet Explorer\iexplore.exe), and then saving the value of that into a database so that later, I can use the stored path to open it with "System.Diagnostics.Process.Start()".

However, the path from the OpenFileDialogBox is something like "C:\Program Files\Internet Explorere\IExplore.exe", and the System.Diagnostics.Process.Start() method requires the backslashes to be escaped with, well, a backslash.

What I need is a for loop or something that will loop through each character in a string and replace each "\" with a "\\". Thank you in advance.

Computers will never surpass the human brain; no computer will ever be able to replicate human stupidity.
__________________
If only computers could write programs themselves...
  #2 (permalink)  
Old June 14th, 2006, 09:18 PM
Registered User
 
Join Date: Mar 2006
Location: HCM, HCM, Vietnam.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to puppyonline Send a message via Yahoo to puppyonline
Default

i think use @ before this string .
axam :
 @"C:\Program Files\Internet Explorere\IExplore.exe".

  #3 (permalink)  
Old June 16th, 2006, 11:31 PM
Authorized User
 
Join Date: Apr 2006
Location: , , Canada.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, thank-you! This is exactly what I needed.

Computers will never surpass the human brain; no computer will ever be able to replicate human stupidity.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing multiple characters in a string philboparker BOOK: XSLT Programmer's Reference, 2nd Edition 0 May 20th, 2008 04:38 PM
Separating strings and replacing characters sunrain XSLT 4 April 7th, 2008 09:33 AM
replacing numbers in a string cole SQL Server 2000 4 April 2nd, 2007 04:24 PM
Replacing characters in external csv file Axxess Access VBA 2 July 15th, 2005 01:39 AM
Replacing a character from string itHighway Classic ASP Basics 5 March 14th, 2005 11:15 PM



All times are GMT -4. The time now is 01:11 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.