Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6194439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:17:49+00:00 2026-05-24T03:17:49+00:00

I am working for application register form and I would like to know when

  • 0

I am working for application register form and I would like to know when the user opens the register form I need to check if the current date is true or not and when the user tries to change the system date he should pop up message.So I would like to refresh the form for every second and find whether he has changed the date or not.
How do I do that?

Here is my code:

 btnRegister.Enabled = False
    Dim oReg As Microsoft.Win32.RegistryKey
    oReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software", True)
    oReg = oReg.CreateSubKey(kstrRegSubKeyName)
    oReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\" & kstrRegSubKeyName)
    Dim strOldDay As String = oReg.GetValue("UserSettings", "").ToString
    Dim strOldMonth As String = oReg.GetValue("operatingsystem", "").ToString
    Dim strOldYear As String = oReg.GetValue("GUID", "").ToString
    Dim strRegName As String = oReg.GetValue("USERID", "").ToString
    Dim strRegCode As String = oReg.GetValue("LOCALPATH", "").ToString
    Dim strCompID As String = oReg.GetValue("CompID", "").ToString
    Dim strTrialDone As String = oReg.GetValue("Enable", "").ToString
    oReg.Close()

    'If the keys should automatically be created, then create them.
    If strOldDay = "" Then
        CreateRegKeys(txtPassPhrase.Text)
    End If

    'If the keys are encrypted, decrypt them.
    'If EncryptKeys = True Then
    strOldDay = Decrypt(txtPassPhrase.Text, strOldDay)
    strOldMonth = Decrypt(txtPassPhrase.Text, strOldMonth)
    strOldYear = Decrypt(txtPassPhrase.Text, strOldYear)
    'End If

    'Define global variables.
    mintUsedTrialDays = DiffDate(strOldDay, strOldMonth, strOldYear)

    'Fill the progress bar
    lblApplicationStatus.Text = DisplayApplicationStatus(DiffDate(strOldDay, strOldMonth, strOldYear), mintTrialPeriod)

    'Disable the continue button if the trial is over
    If DiffDate(strOldDay, strOldMonth, strOldYear) > mintTrialPeriod Then
        'unregbutton.Enabled = False
        mblnInTrial = False
        btnRemind.Enabled = False
        oReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software", True)
        oReg = oReg.CreateSubKey(kstrRegSubKeyName)
        oReg.SetValue("Enable", "1")
        oReg.Close()
    End If




    If strOldMonth = "" Then

    Else

        Dim dtmOldDate As Date = New Date(Convert.ToInt32(strOldYear), Convert.ToInt32(strOldMonth), Convert.ToInt32(strOldDay))
        If Date.Compare(DateTime.Now, dtmOldDate) < 0 Then
            'lblApplicationStatus.Text = DisplayApplicationStatus(mintTrialPeriod, mintTrialPeriod)
            lblApplicationStatus.Text = "The system clock has been manually changed, and the application has been locked out to prevent unauthorized access!"
        End If
    End If


    'If the trial is done then disable the button
    If strTrialDone = "1" Then
        mblnInTrial = False
        btnRemind.Enabled = False
        lblApplicationStatus.Text = "The system clock has been manually changed, and the application has been locked out to prevent unauthorized access!"
    End If

    'See if the user is already registered, if so re-process the info and check if the computer is all okay.,
    If strRegName = "" Then
    Else
        Dim strRN As String = Decrypt(txtPassPhrase.Text, strRegName)
        Dim strRC As String = Decrypt(txtPassPhrase.Text, strRegCode)
        Dim UserName As String = strRegName
        UserName = UserName.Remove(16, (UserName.Length - 16))
        If UserName = Decrypt(txtPassPhrase.Text, strRegCode) Then
            If Encrypt(txtPassPhrase.Text, cHardware.GetMotherBoardID.Trim.ToString) = strCompID Then
                mblnInTrial = False
                mblnFullVersion = True
                strRC = strRC.Insert(4, "-")
                strRC = strRC.Insert(8, "-")
                strRC = strRC.Insert(12, "-") 'Add dashes to make it look cool
                lblApplicationStatus.Text = "Licensed version to " + strRN + " with the key " + strRC
                txtVKClientName.Enabled = False
                txtKeyToValidate.Enabled = False
                txtVKClientName.Text = strRN
                txtKeyToValidate.Text = strRC
                btnRemind.Text = "Registered"
                frmMain.Text = "Aquamark v1.2(Registered)"
                btnRegister.Hide()
                Me.Close()
                frmMain.Show()
                oReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software", True)
                oReg = oReg.CreateSubKey(kstrRegSubKeyName)
                oReg.SetValue("Enable", "")
                oReg.Close()
            End If
        End If
    End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:17:50+00:00Added an answer on May 24, 2026 at 3:17 am

    NO, you don’t have to “refresh the form for every second and find whether he has changed the date or not. How do I do that“, the solution is a lot easier

    The windows will send a message to all applications when the data is changed. Listen to that message instead and whenever the data changed do what you want to do so:

    //C# sorry I don’t know VB but the code is simple and you should convert it without any problem

    private DateTime _lastSystemClockChanged = DateTime.MinValue;
    
    protected override void WndProc(ref Message m)
    {
        switch (m.Msg)
        {
            case 0x1E://the time is changed. 
                //to avoid receiving duplicate notification about time changed
                if (_lastSystemClockChanged.AddSeconds(1) < DateTime.Now ||
                    _lastSystemClockChanged > DateTime.Now)
                {
                    _lastSystemClockChanged = DateTime.Now;
                    //do what ever you want to do when time changed. note you should 
                    //not call a methods that will block here because of you will block 
                    //this message from arriving to other applications then
                }
                break;
        }
        base.WndProc(ref m);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my application's current workflow for user registration. register form ( GET /register
Preface: I'm not sure what resources are. I need this form (which is working
I've been working on a till/cash-register application. We need to prevent the users from
I am working on an application that requires user authentication to access a profile.
I'm now working on Sample login application in which user can login with their
I would like to create user in my user table when new user have
I am trying to register RichTx32.Ocx for an application I am working on in
My JavaScript was working and now it's not. It's just to validate the form
I am Working on simple login application in which user is first shown login
I'm working on a MP3 application in which I'd like to index the files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.