list forbiden string in path

  • Thread starter Thread starter Pascal
  • Start date Start date
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
 
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
 
Back
Top