Sorry for the bad title but i don't know how to describe my problem in short.
When i run the application. It didn't write the Text to the file. I have added the MessageBox's to see where the code interrupts. MsgBox 1 and 2 are shown, but 3 isn't. So the code interrupts after:
file = My.Computer.FileSystem.OpenTextFileWriter("C:\text.txt", True)
Why is that?
Form1.vb:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim main As New Main()
Call main.Main()
End Sub
End Class
Main.vb:
Public Class Main
Sub Main()
MessageBox.Show("1")
Dim file As System.IO.StreamWriter
MessageBox.Show("2")
file = My.Computer.FileSystem.OpenTextFileWriter("C:\text.txt", True)
MessageBox.Show("3")
file.WriteLine("Text")
file.Close()
End Sub