Click here to Skip to main content
15,845,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I am trying to read the xml with Path Is Like This: C:\Users\DIARA.RZ\Desktop\rabih\MagazineBuilderBin[10-5-2014]\bin\Debug\Page/TOB.xml

the folder name "DIARA.RZ" creating problem, how can i allow the special characters like(.) in the path.

I am generating Filename using below function where FolderName is veriable and its Contains the the name of file.

public static string GetFilePath()
var path = @System.AppDomain.CurrentDomain.BaseDirectory + "FlipBook_" + FolderName;
return path;

and I am getting error when I am using this path to access the XML file. but when i removing the Dot(.) from folder name it works fine.

1 solution


why using '/' in place of '\' at last?

besides use this

using System.IO;

public static string GetFilePath()
var path = @System.AppDomain.CurrentDomain.BaseDirectory + "FlipBook_" + FolderName;
return Path.GetFullPath(path);
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900