텍스트 파일에 저장하고 읽기
*
Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As New System.IO.StreamWriter("c:\test.txt", True)
f.WriteLine(RichTextBox1.Text)
f.Close()
f.Dispose()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim f As New System.IO.StreamReader("c:\test.txt")
OpenFileDialog1.ShowDialog()
RichTextBox1.Text = f.ReadToEnd
f.Close()
f.Dispose()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
RichTextBox1.Text = ""
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Close()
End Sub


End Class

11.PNG

이 게시물을

공유하기

SEARCH

MENU NAVIGATION