In Focus
Jabalpur Chapter - Windows 8 Developers Day
Delhi Chapter Hands On June 22: Limited Seats Register Now
Kolkata Chapter Developer Day: May 25
C# Corner Delhi Chapter Meet, May-18, 2013 Official Recap
Istanbul Chapter May 2013 2nd Seminar Announced : Learn WinJS, Windows Store, MVC
Email :
Password :
Remember me?
Forgot password
Technologies
Monthly Leaders
ASK A QUESTION
C# Programming
Multi-threading
Microsoft Surface
Community Services
Java
.NET General
Office Interoperability
ReFS
Current Affairs
JQuery
Active Directory
Printing
Silverlight 5
Fun and Jokes
JSP
ADO.NET & Database
Project Management
WCF
Job Opportunities
Multimedia, Graphics, Flash
AJAX & Atlas
Remoting
Windows 8
Leadership
PHP
Algorithms & AI
Reporting
Windows Azure
Mac for Windows
Social Networking
Arrays & Collections
Robotics and Hardware
Windows Store Apps
Microsoft Feedback
TypeScript
ASP.NET & Web Development
Security & Cryptography
Workflow Foundation
Open Source Projects
Web Hosting
C# Language
Setup & Deployment
WPF
Operating Systems
Website Management
C# References
Sharepoint
XAML Language
Paid Projects
Windows Azure
CLR & .NET Internals
Speech & Voice Recognition
Site and Forums Feedback
Prizes, Awards, MVP
Windows Phone 7
COM Interoperability
Tablet PC
Announcements
Students & Beginner Projects
Database
Custom Controls
Testing and QA
Author Guidelines
Test Category
Database General
Design and Architecture
Visual Basic .NET
Bugs and Problems
Training & Certification
Oracle
Embedded Development
Visual C++
Forums Feedback
Web Development
SQL
Enterprise Development
Visual Studio 11
Site Feedback & Suggestions
Advertising, Marketing, SEO
SQL Server
Games, DirectX, and XNA
Visual Studio 2010
Site Spams
Android
Products
GDI+ and DirectX
Web Services
Miscellaneous
Cloud Computing
Office 2013
General
Windows Forms
.NET Books
Expression Tools
Products
LINQ
Windows Services
Ask the Author
HTML 5
SharePoint 2013
Migrating to .NET
Cutting-Edge
Career Advice
HTML, JavaScript, CSS
Windows 8
Mobile Development
.NET 5.0
Coffee, Chai Lounge
iPhone, iPad
Forum guidelines
Home
»
C# Language
»
C# directory path name contains invalid character
Author
Question
dc
C# directory path name contains invalid character
Posted on: 19 Nov 2012
In a C# 2008 application, I want this program to point to a executable that it needs to run called 'client.exe' as indicated by the app.config file value I listed below. My problem is the part of the directory path called 'co1 & co2' has an illegal charcter in it which is the '&' part. The production location has this name in it.
Thus can you tell me how to change the '&' part of 'co1 & co2' so that the & will be a valid part of the directory path?
Here is the app.config file I am referring to:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="client_location" value="C:\Program Files (x86)\co1 & co2\client.exe" />
</appSettings>
</configuration>
Reply
Quick Reply
Report a Spam
Our Recommended Solutions
CustomWebControlsLib
How to get directory of a file in C#
Create FTP and Web IIS Virtual Directory using C#
How to Overcome Error "Access to the Path Containing 'hash.web' is Getting Denied."
Working With Drives and Directories in ASP.NET
Practical Approach of Creating and Removing Directory To/from FTP Path
Practical Approach of Getting Directory List and Its Details From FTP Path
Write Characters to XML using C#
Adding Groups / User names and Permissions for a Directory in C#
Named arguments in C# 4.0
[ + ]
Author
Reply
Vulpes
0
0
accepted
Re: C# directory path name contains invalid character
Posted on: 19 Nov 2012
Accepted Answer
Not sure whether Mahesh's solution will work or not.
I'd have thought you'd need to change:
& to &
for the XML file to be valid.
Reply
Quick Reply
Mahesh Chand
0
0
Re: C# directory path name contains invalid character
Posted on: 19 Nov 2012
I think you use double & (&&) if I remember correctly.
Admin
Being Humble is a virtue, not weakness!
Reply
Quick Reply
Quick Reply:
SEARCH ANSWERS
All
C# Programming
Cutting-Edge
Site and Forums Feedback
Miscellaneous
Web Development
Database
Products
Any Word
Exact Word
Our recommended forum posts
Connecting Visual Studio 2010 with Sql server 2012
C#, WPF and MVVM ... How to load an XML file into a dataset
c# project related problem
How to know on which combo box event fired
Default value for Multiple TextBoxes in C#
scrabble tournament system
C# Custom Control Handling
Please Provide the Solution to scan a File with C#
How to get database name in C#
how to download a Msword file?
HOT QUESTIONS
c# writing user input from form to text file using windows a
Import/Export Generic List Objects
System.Collection.IList
Create List accessible for other classes
Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)
Extracting Data from a listbox in Another Application
mathematical euation
code is not working
how can i locate a webbrowser control
Congratulation Vinod Kumar
SPONSORED BY
DynamicPDF ReportWriter Suite
PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.