Results 1 to 3 of 3

Thread: [RESOLVED] Picking value from Text File and App.Path

Threaded View

  1. #1

    Thread Starter
    Addicted Member rpk_20061975's Avatar
    Join Date
    Jun 2001
    Location
    India
    Posts
    234

    Resolved [RESOLVED] Picking value from Text File and App.Path

    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:

    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
    Secondly, how to use App.Path (of VB6) here in the code in the line where the path of the Text File is given.
    Last edited by rpk_20061975; Feb 5th, 2006 at 11:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width