Results 1 to 6 of 6

Thread: [RESOLVED] Trigger event every second

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Location
    Taiwan
    Posts
    37

    Resolved [RESOLVED] Trigger event every second

    hi there..
    i'm writing rfid code now, and i got some problem with event.
    i need to trigger the OpenCard() function automatically, so that whenever i placed my tag on the reader, it automatically triger the function and open the card.

    To solve this problem, i'm thinking of calling the function 20 times every second. But i don't know what 'time' class/attribute to use to work with this.

    Anybody can help me ?
    Or may be another technique beside calling the function 20 times every second?

    sorry for my bad english, and thx for reading anyway...

  2. #2
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Trigger event every second

    Since I know nothing about the rfid code you're talking about or if the object/SDK/ect even has any events... I'll give you the nasty "20x a second" code:
    Code:
    		private System.Timers.Timer tmr = new System.Timers.Timer(50);
    		private void Form1_Load(object sender, System.EventArgs e)
    		{
    			tmr.Elapsed += new System.Timers.ElapsedEventHandler(tmr_Elapsed);
    			tmr.Start();
    		}
    
    		private void tmr_Elapsed (object obj, System.Timers.ElapsedEventArgs e)
    		{
    			System.Windows.Forms.MessageBox.Show("Elapsed");
    		}

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Trigger event every second

    Ugh. Another crosspost.

  4. #4
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Trigger event every second

    Quote Originally Posted by mendhak
    Ugh. Another crosspost.
    We really need a "Hall of Shame" or something....

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2006
    Location
    Taiwan
    Posts
    37

    Re: Trigger event every second

    uhm..
    sorry for da crosspost..
    just don't know exactly where i need to post the question..

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Trigger event every second

    Quote Originally Posted by ini_hendry
    uhm..
    sorry for da crosspost..
    just don't know exactly where i need to post the question..
    Pick the forum that seems most appropriate and post there. Do NOT post the same question a second time. If you want your original thread moved to a different forum then PM the moderator of either the forum you're in or the forum you want to be in.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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