473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using special characters in file name.

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
Nov 15 '05 #1
2 6706
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" <mu****@no.spam.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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


Nov 15 '05 #2
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 [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:O6**************@tk2msftngp13.phx.gbl...
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" <mu****@no.spam.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Mosher | last post by:
Hi all, I have an issue with php and/or mysql. I have a php form that writes "items" to a mysql database, including a description of the item. On the mysql server, "magic_quotes_gpc" is ON. I...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: Dorsa | last post by:
HI, Could you please tell me the error in here. I am trying to open an XML file from a link. Response.Clear() Response.Expires = 0 Response.BufferOutput = False Response.ContentType =...
12
by: Jerry Camel | last post by:
Not sure if this is a good place to post this... I'm writing and ASP.net app using vb .net. I need to interact with a credit card reader. I have one that sits inline with the keyboard. Works...
17
by: Carl Mercier | last post by:
Hi, Is it possible to use special characters like \n or \t in a VB.NET string, just like in C#? My guess is NO, but maybe there's something I don't know. If it's not possible, does anybody...
9
by: Larry | last post by:
OK, I've been searching around the net for numerous hours and seem to just be getting more confused about handling special characters. In my host's configuration MagicQuotes is ON. (I understand...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
3
Ciary
by: Ciary | last post by:
hi all, i'm stuck with a rather rare situation. like most some people will know, i've been busy trying to set an uploaded pdf as background image. now, i encountered a new problem. let me explain...
1
by: ArizonaJohn | last post by:
Hello, I would like to allow users to add tables to my database with special characters in the table names. The characters I would like to allow include #, &, *, and +. Below is my code which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.