If you are using it in code you need two \\
example
C:\\users\\bob\\documents\\text.txt
Can some1 tell me where are the illegal characters there?Code:K:\GSC Compiler v5.0\GSC Compiler v5.0\bin\Release\library\includes\common_scripts\_fx.gsc
Last edited by ♪~ ᕕ(ᐛ)ᕗ; 07-09-2011 at 12:27 PM.
If you are using it in code you need two \\
example
C:\\users\\bob\\documents\\text.txt
no no.
I actually placed some files on a folder at the startup path of my app. In the textbox when the user imports one of those files it will add each imported file to a list, and then parse them. The files buffer are going to be added to an other list.
So I don't place only one path. here's the code for importing the buffer and the files....
But if the file has a "_" it will throw a message, Invalid characters in path or something....Code:''' <summary> ''' Gets every included file's ''' </summary> ''' <remarks></remarks> Public Sub GetIncluded() Dim calledFiles As New List(Of String) Dim tScr As String() = scr.Split(vbCrLf) For Each x In tScr If *****ntains("#include") Then calledFiles.Add(x) End If Next For Each xp In calledFiles Dim file As String = xp.Replace("#include ", "") Incs.Add(file.Replace(";", "")) Next End Sub ''' <summary> ''' Fills the buffer with the included file's text ''' </summary> ''' <remarks></remarks> Public Sub ParseFiles() For Each x In Incs Dim dir As String = Path.Combine(CurDir() & "\library\includes\", x) dir = dir.Insert(dir.Length, ".gsc") MsgBox(dir) For Each xpp As Char In Path.GetInvalidPathChars() Dim f As String = Path.GetPathRoot(dir) For Each xp In f If xpp = xp Then MsgBox("Cannot parse file '" & f & "'. Invaild path characters found.") End If Next Next Using sRead As New StreamReader(dir) Form1.status = "Parsing file..." & dir Buffer.Add(sRead.ReadToEnd) End Using Next Form1.status = "Ready" End Sub
quick solution: don't use a _ ?
Dim dir As String = Path.Combine(CurDir() & "\library\includes\", x)
I don't do VB so not sure, but shouldnt that & be a +? also try \\ instead of \
Ah we-a blaze the fyah, make it bun dem!
HeavenlyRage (08-16-2011)