*.*"
SaveFileDialog1.FilterIndex = 0
If SaveFileDialog1.ShowDialog = DialogResult.OK Then
Dim FS As FileStream = SaveFileDialog1.OpenFile
Dim SW As New StreamWriter(FS)
SW.Write(TextBox1.Text)
SW.Close()
FS.Close()
End If
同样采用类似的语句,我们读取一个文本文件,并把内容显示在TextBox控件中。StreamReader的ReadToEnd方法返回文件的全部内容。
OpenFileDialog1.Filter = _
"Text Files(北联网教程,专业提供视频软件下载)
……