0
Dim FileTrue As Boolean = True
        While FileTrue = True
            If My.Computer.FileSystem.FileExists("/Paths/aPath.txt") Then
                Form2.RichTextBox1.LoadFile("/Paths/aPath.txt", RichTextBoxStreamType.PlainText)
            Else
                Call PathSet()
                FileTrue = False
                End
                If My.Computer.FileSystem.FileExists("/Paths/mPath.txt") Then
                    Form2.RichTextBox2.LoadFile("/Paths/mPath.txt", RichTextBoxStreamType.PlainText)
                Else
                    Call PathSet()
                    FileTrue = False
                    End
                    If My.Computer.FileSystem.FileExists("/Paths/lPath.txt") Then
                        Form2.RichTextBox3.LoadFile("/Paths/lPath.txt", RichTextBoxStreamType.PlainText)
                    Else
                        Call PathSet()
                        FileTrue = False
                        End
                        If My.Computer.FileSystem.FileExists("/Paths/wPath.txt") Then
                            Form2.RichTextBox4.LoadFile("/Paths/wPath.txt", RichTextBoxStreamType.PlainText)
                        Else
                            Call PathSet()
                            FileTrue = False
                            End
                        End If
                    End If
                End If
            End If
        End While

This in a Function being called at Load just doesn't work. No errors the Program won't even show up.

I am DEBUGGING not Released. Does it need to be installed for the paths to be read and created?

2
Contributors
4
Replies
5
Views
4 Years
Discussion Span
Last Post by Reverend Jim
0

Try using absolute file paths and replacing the forward slash with a back slash. Also, this won't make a difference, but you can reword your loop header as

While FileTrue
0

I can't use absolute File Paths as they are defined by where the Program is Located, Which is ultimatly up to the user.

0

You can use absolute file paths by querying the system to find out where the application is located then building your path based on that.

System.IO.Directory.GetCurrentDirectory()

returns the current directory/folder.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.