Hi,
I want my application to store the last Ticket No in a text file and when it starts again, it should pick the last number and increment it by 1 to start again.
I am not following how to pick the value written in text file, though I attempted as below:
Secondly, how to use App.Path (of VB6) here in the code in the line where the path of the Text File is given.Code:Public Function LoadPNoFromFile() Dim fs As IO.FileStream = New IO.FileStream("C:\KTR\KTR\ePermit2\Data\pno.txt", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite) Dim br As IO.BinaryReader = New IO.BinaryReader(fs) Dim bw As IO.BinaryWriter = New IO.BinaryWriter(fs) Dim GetNum(1000) As Byte Dim myVal As Long Try myVal = br.ReadByte MsgBox(myVal) fs.Close() Catch ex As Exception End Try End Function




Reply With Quote