[求助]关于文件存控件的问题
Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.ClickIf filename = Nothing Then
Saveas()
Exit Sub
End If
Dim fs As System.IO.FileStream = Nothing
Try
If System.IO.File.Exists(filename) Then '这段怎么搞的,始终有问题
fs = New System.IO.FileStream(filename, FileMode.Open)
Else
fs = New System.IO.FileStream(filename, FileMode.Create)
End If
Dim sw As New IO.StreamWriter(fs)
sw.BaseStream.Seek(0, SeekOrigin.Begin)'这个函数的用途?
sw.Write(RichTextBox1.Text)
sw.Flush() '这个函数的用途是什么啊
sw.Close() '这个函数的用途是什么啊
End Sub