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?

Recommended Answers

All 4 Replies

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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.