Using special characters in file name.

  • Thread starter Thread starter muscha
  • Start date Start date
M

muscha

Hello,

I want to save a URL in local file using it's URI as the file name. But I
can't use the "/" character. What is the best way for me to do this? Should
I convert all the slashes to _ or something like that?

Thanks for any input

/m
 
Hello,

Yes, you should convert all characters that are not valid for file names to
those that are acceptable. Look, for example, how Internet Explorer or
Outlook Express replace such characters when saving a web page or a message
to disk.
 
Ok,

Is there a class library in .Net that does this for me? Or do I have to do
it myself.

thanks,

/m

Dmitriy Lapshin said:
Hello,

Yes, you should convert all characters that are not valid for file names to
those that are acceptable. Look, for example, how Internet Explorer or
Outlook Express replace such characters when saving a web page or a message
to disk.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

muscha said:
Hello,

I want to save a URL in local file using it's URI as the file name. But I
can't use the "/" character. What is the best way for me to do this? Should
I convert all the slashes to _ or something like that?

Thanks for any input

/m
 
Back
Top