Me n My Programming

If Only I Have TIme

Illegal characters in path

I tried to open a template files for my apps and all I got is an error saying “Illegal characters in path”. So I google my way and found out that you need to insert @ in front of your path. Simple eh? Look at the example:


FileStream fs;

string path = Application.StartupPath + “\\..\..\templates\template.xml”;
fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);


string path = Application.StartupPath + @“\\..\..\templates\template.xml”;

Further explanation you can read from here:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


This entry was posted on June 26, 2008 by in C# and tagged .
%d bloggers like this: