Public Sub WriteTextandSaveFile()
Dim fs As FileStream = Nothing
Dim sw As StreamWriter = Nothing
Try
fs = New FileStream("D:\Sample\Sample1.txt", FileMode.Create, FileAccess.Write)
sw = New StreamWriter(fs)
sw.WriteLine("This is Sample text")
Catch ex As Exception
Finally
sw.Close()
fs.Close()
sw.Dispose()
fs.Dispose()
End Try
End Sub
never regret anything, if it was good, its wonderful, if it was bad, its experience!
No comments:
Post a Comment