student101
Member
- Joined
- Dec 22, 2007
- Messages
- 10
- Programming Experience
- 3-5
hi , i wanna write an application , it holds some data into a .dat file .
i wrote it with structure !
i can add some data into it but i don' know how to edit it !
for example , we have this data into a .dat file :
this is my code :
this code is for adding ( appending ) some data into it .
& now i wanna edit a specific part of this code !!
someone helps me
thanks...
i wrote it with structure !
i can add some data into it but i don' know how to edit it !
for example , we have this data into a .dat file :
so if i want to edit ( carlos , 19 ) . how cn i do that ?jack
15
carlos
19
imoa
16
this is my code :
VB.NET:
Imports Microsoft.VisualBasic.FileSystem
Structure Person
Public Name As String
Public Age As Long
Public mob As Boolean
End Structure
Dim APerson As New Person()
Dim fr As Integer = FreeFile()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FileOpen(fr, "D:\data.dat", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.LockReadWrite)
APerson.Name = TextBox1.Text
APerson.Age = TextBox2.Text
FilePut(fr, APerson, LOF(fr) + 1)
FileClose(fr)
End Sub
& now i wanna edit a specific part of this code !!
someone helps me
thanks...
Last edited by a moderator: