RE: file access with VB.NET
From: Rulin Hong (RulinHong_at_discussions.microsoft.com)
Date: 06/29/04
- Next message: Roman: "Re: Hidden custom components"
- Previous message: BrianDH: "Need to find a word within a string"
- In reply to: Dave Cullen: "file access with VB.NET"
- Next in thread: Dave Cullen: "Re: file access with VB.NET"
- Reply: Dave Cullen: "Re: file access with VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 29 Jun 2004 10:33:01 -0700
Private Sub Read()
'Read
If System.IO.File.Exists("FileName") Then
Dim myFileStream As System.IO.FileStream = System.IO.File.OpenRead("FileName")
Dim myStreamReader As New System.IO.StreamReader(myFileStream)
Dim myStr As String = myStreamReader.ReadToEnd
myStreamReader.Close()
End If
End Sub
Private Sub Write()
'Write
Dim myFileStream As New System.IO.FileStream("FileName", IO.FileMode.OpenOrCreate)
Dim myStreamWriter As New System.IO.StreamWriter(myFileStream)
Dim myStr As String = "Sample string"
myStreamWriter.WriteLine(myStr)
myStreamWriter.Close()
End Sub
- Next message: Roman: "Re: Hidden custom components"
- Previous message: BrianDH: "Need to find a word within a string"
- In reply to: Dave Cullen: "file access with VB.NET"
- Next in thread: Dave Cullen: "Re: file access with VB.NET"
- Reply: Dave Cullen: "Re: file access with VB.NET"
- Messages sorted by: [ date ] [ thread ]