473,396 Members | 1,748 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,396 software developers and data experts.

list forbiden string in path

hello
can you tell me the list of the forbiden characters that we can not use in
the path. because i have to replace them from a string
i use this code, but i think it is not complete :
Private Function ReplaceChars(ByVal Text As String)
Try
Dim mystrArray As Char() = {"/", ":", ";", "*", "?", "<", ">",
"""", "|"}
Dim i As Integer
Dim ReplaceBy As Char = "_"
For i = 0 To UBound(mystrArray)
Text = Text.Replace(mystrArray(i), ReplaceBy)
Next
Catch fileException As Exception
Throw fileException
End Try
Return Text
End Function

--
http://www.scalpa.info
http://scalpa98.blogspot.com/
http://scalpa-production.blogspot.com/

Sep 14 '08 #1
2 1008

"Pascal" <sc************@scalpa.infokirjoitti viestissä
news:11**********************************@microsof t.com...
hello
can you tell me the list of the forbiden characters that we can not use in
the path. because i have to replace them from a string
i use this code, but i think it is not complete :
Hello!

Check out these:

Member of System.IO.Path:

Public Shared Function GetInvalidPathChars() As Char( )
Public Shared Function GetInvalidFileNameChars() As Char( )

Those functions will give you all illegal characters.

-Teemu

Sep 14 '08 #2
Thanks a lot : fast and efficient answer !
--
http://www.scalpa.info
http://scalpa98.blogspot.com/
http://scalpa-production.blogspot.com/

"Teemu" <ts*****@hotmail.coma écrit dans le message de
news:cX*******************@reader1.news.saunalahti .fi...
>
"Pascal" <sc************@scalpa.infokirjoitti viestissä
news:11**********************************@microsof t.com...
>hello
can you tell me the list of the forbiden characters that we can not use
in the path. because i have to replace them from a string
i use this code, but i think it is not complete :

Hello!

Check out these:

Member of System.IO.Path:

Public Shared Function GetInvalidPathChars() As Char( )
Public Shared Function GetInvalidFileNameChars() As Char( )

Those functions will give you all illegal characters.

-Teemu
Sep 14 '08 #3

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

Similar topics

15
by: Josef Meile | last post by:
Hi, Textually from the highlights of python 2.4: "Assigning to None - the compiler now treats assigning to None as a SyntaxError." I think in general assignments to built-in types,...
0
by: Mythran | last post by:
I wrote some code that is supposed to enumerate through the specified file's win32 resources and return a string-array of all icon names. When it runs, it returns a string-array with a bunch of...
2
by: Dudule | last post by:
Hello, No answer from "comp.lang.basic.visual.misc", so i try to post here...: Using WINSOCK to acces the Web, in Visual basic 6 application, most of the time it is working fine, but with some...
1
by: chrisfost | last post by:
Is it possible by using attributes to serialize a <List<List<Point>> property to output as shown below? Current Output <PolyPolyline> <ArrayOfPoint> <Point> <X>5</X> <Y>5</Y>
10
by: Jeff Williams | last post by:
How can I get a list of the Groups both Local and Domain groups a User belongs to.
3
by: funkyj | last post by:
I want to call os.path.join() on a list instead of a variable list of arguments. I.e. (186:0)$ python iPython 2.4 (#2, Feb 18 2005, 16:39:27) ] on freebsd4 Type "help", "copyright",...
6
by: kimiraikkonen | last post by:
Hello, I have a listbox and folder browser control. I need to display all .mp3 files' pathes into listbox. It was Ok with openfiledialog but how can list all .mp3 extension- having files into...
6
by: Shawn Minisall | last post by:
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. ...
6
by: tgnelson85 | last post by:
Hello, C question here (running on Linux, though there should be no platform specific code). After reading through a few examples, and following one in a book, for linked lists i thought i would...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.