'Make sure you import "Imports System.IO"
Dim openFileDialog1 As OpenFileDialog
If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
   'declaring a FileStream and creating a document and access mode
   Dim myfilestream As New FileStream(OpenFileDialog1.FileName, FileMode.Create, FileAccess.Write)
   'creating a new StreamWriter
   Dim s as new StreamWriter(myfilestream)
   'writing text to file
   s.WriteLine("Write Some data here!")
   s.WriteLine("Write Some More data here!")
   s.Close()
End If


One of my favorite Book on Visual Basic Programming

 
SGoogleearch for more Code Samples   

Copyright 2004-2009 Excalibur software Solutions All rights reserved
Note: Any unsolicited email sent to Excalibur Software Solutions or any members of Excalibur Software Solutions, will be archived and a fee of $5.00 dollars US per email per month will be charged to the content owner of said email. The Content Owner must inform Excalibur Software Solutions in writing; they no longer require archive services for each email archived within 30 days of cancelation. The content holder is defined as the entities represented in email regardless of sender. The sender is the representative of the content holder.