p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

pro_vb thread: Re: 2 great questions!!!!!!!!


Message #1 by <kk8877@y...> on Wed, 25 Apr 2001 11:04:47 +0530
You could place it in a resorce file or in a persistant object.



-----Original Message-----
From: Jeffrey J Reddy [mailto:jeffr@l...]
Sent: 25 April 2001 12:42
To: professional vb
Subject: [pro_vb] Re: 2 great questions!!!!!!!!


You can try this method of storing info in a text file.  Instead of giving
the text file a txt extension, give it a bogus extension. Something unique
that the user wouldn't know what to open it with.  This is in no way full
proof, but with the txt extension your practically inviting the user to open
it. VB won't care what extension you give the file, as long as you use that
extension properly in code.

  ----- Original Message -----
  From: Karthik Kodavatiganti
  To: professional vb
  Sent: Wednesday, April 25, 2001 12:34 AM
  Subject: [pro_vb] Re: 2 great questions!!!!!!!!


  Hi,

  Is it a good idea to store such information in a text file? The user would
be easily able to edit the text file and keep using the application for
ever.

  Storing the value in registry is also not safe since registry is also
editable.

  Is there a better and secure way to do this?

  regards,
  Kart
    ----- Original Message -----
    From: Yoel Pedersen
    To: professional vb
    Sent: Monday, March 05, 2001 1:10 PM
    Subject: [pro_vb] Re: 2 great questions!!!!!!!!


    Hello

    If you want to make sure your program expires after 15 days, you can do
it
    this way:

    Installation: Write current time to registry, or save it in a file in
the
    C:\Windows directory.

    Each program start: Load the time and see if the difference between
    installation date and current date is more than 15 days.


    How to save a file:

    Dim FileNumber as Integer

    FileNumber = FreeFile

    Open "C:\File.txt" For Output As #FileNumber

    Print #FileNumber, "This is the data to put into the file"

    Close #FileNumber


    How to load data from a file:

    Open "C:\File.txt" For Input As #FileNumber

    Dim myInput As String

    myInput = Input(LOF(#FileNumber),#FileNumber)

    Close #FileNumber

    (or so....!)

    Hope this helps.

    Sincerely, Yoel Pedersen
    ---





  Return to Index