list forbiden string in path

P

Pascal

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
 
T

Teemu

Pascal said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top