|
-
Aug 2nd, 2006, 08:53 AM
#1
Thread Starter
Member
[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...
-
Aug 2nd, 2006, 09:03 AM
#2
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");
}
-
Aug 2nd, 2006, 09:21 AM
#3
Re: Trigger event every second
-
Aug 2nd, 2006, 09:25 AM
#4
Re: Trigger event every second
 Originally Posted by mendhak
Ugh. Another crosspost.
We really need a "Hall of Shame" or something....
-
Aug 7th, 2006, 01:10 AM
#5
Thread Starter
Member
Re: Trigger event every second
uhm..
sorry for da crosspost..
just don't know exactly where i need to post the question..
-
Aug 7th, 2006, 01:15 AM
#6
Re: Trigger event every second
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|