Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
'-- フォームを閉じる
Me.Close()
End Sub
Private Sub MenuItem2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
'-- ファイルを読み込む
Dim reader As StreamReader = New StreamReader("D:\TEST.TXT", System.Text.Encoding.Default)
If reader.Peek() <> -1 Then
Text1.Text = reader.ReadToEnd
End If
reader.Close()
reader = Nothing
End Sub
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
'-- ファイルを書き込む(1行ずつ書き込む場合は WriteLine を使います。)
Dim writer As StreamWriter = New StreamWriter("D:\TEST.TXT", False, System.Text.Encoding.Default)
writer.Write(Text1.Text)
writer.Close()
writer = Nothing
End Sub
|