borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Restrict Paste in RichTextbox)Next Topic (how i can take apicture for the form in execution) New Topic New Poll Post Reply
AndreaVB Forum : VB General : SAVE date in .INI file
Poster Message
ashiyr
Level: Protégé

Registered: 05-04-2007
Posts: 5

icon SAVE date in .INI file

kindly help.all i want here is to save the first date so that the next load it will read DATEDIFF then subtract the 1st date and 2nd date. but what happen here it always read the current date so the outcome is always zero(0).how can i save the 1st date without changing it from the current date everytime it loaded so it counts the difference?

file = App.Path & "\Valid.ini"    

If sHsUserNameValue = "" Then

   lbAppName = "Set"
   sHsUserStart = "Start"
   sHsUserValue = Date
   lpFileName = file
  
  
   status1 = WritePrivateProfileString(lbAppName, sHsUserStart, sHsUserValue, lpFileName)

End If

      
If sHsUserValue <> "" Then

   stdiff = DateDiff("d", sHsUserValue, Date)
   lblAppname = "Set"
   sHsDatetext = "Current Date"
   sHsDataDate = Date
   sHsDateUsed = "TimesUsed"
   sHsTimesUsed = stdiff
   lpFileName = file
  
      status1 = WritePrivateProfileString(lbAppName, sHsDatetext, sHsDataDate, lpFileName)
   status2 = WritePrivateProfileString(lbAppName, sHsDateUsed, sHsTimesUsed, lpFileName)
    


End If

If sHsTimesUsed >= 10 Then
   frmSerial.cmdRead.Enabled = False
End If

02-05-2007 at 09:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: SAVE date in .INI file

Hello. It's not clear what difficulties you are experiencing, but you might want to have a read at this article of mine, about INI files managing techniques.
Hope you'll find it useful (if so, rate or comment it).

____________________________
Real Programmer can count up to 1024 on his fingers

02-05-2007 at 09:35 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : SAVE date in .INI file
Previous Topic (Restrict Paste in RichTextbox)Next Topic (how i can take apicture for the form in execution) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder