با سلام
دوست عزیز آیا نوع اطلاعاتی که می خواین دراین فایل ذخیره بشه با فرمتی خاصی باید باشه آیا باید Encrypt بشه ؟ درکل نوشتن همچین فایلی بسیار آسونه شما با چندین روش میتونین کار کنین . نمونه کد زیر ساده ترین روشه .
' Load the file's contents into the TextBox.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
Try
Dim file_name As String = Application.StartupPath() _
& "\text.dat"
Dim stream_reader As New IO.StreamReader(file_name)
Try
txtFileContents.Text = stream_reader.ReadToEnd()
txtFileContents.Select(0, 0)
Finally
stream_reader.Close()
End Try
Catch exc As System.IO.FileNotFoundException
' Ignore this error.
Catch exc As Exception
' Report other errors.
MsgBox(exc.Message, MsgBoxStyle.Exclamation, "Read " & _
"Error")
End Try
End Sub
' Save the current text.
Private Sub Form1_Closing(ByVal sender As Object, ByVal e _
As System.ComponentModel.CancelEventArgs) Handles _
MyBase.Closing
Try
Dim file_name As String = Application.StartupPath() _
& "\text.dat"
Dim stream_writer As New IO.StreamWriter(file_name, _
False)
Try
stream_writer.Write(txtFileContents.Text)
Finally
stream_writer.Close()
End Try
Catch exc As Exception
' Report all errors.
MsgBox(exc.Message, MsgBoxStyle.Exclamation, "Read " & _
"Error")
End Try
End Sub
نمونه کدش رو هم ضمیمه کردم .
منبع : http://www.vb-helper.com/howto_net_r...text_file.html
یا علی