|
|
Hi,
I want to build a mechanism for Scheduling some tasks, and found that Timer class would be a right option, but if my interval is large that is let's say 2 day still Interval need to be in m.seconds?
AddHandler aTimer.Elapsed, AddressOf OnTimedEvent
aTimer.Interval =
aTimer.Enabled = True
Thanks in advance...
|
|
|
|
|
Yes, the interval for a timer has to be milliseconds.
If you want some code to execute every two days then you should perhaps use the windows scheduler instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
No i cant go for Windows Scheduler since i use some API mechanisms.
So it will not a be a problem right though i use interval as 2 days in Timer Interval?
Thanks ...
|
|
|
|
|
satsumatable wrote: No i cant go for Windows Scheduler since i use some API mechanisms.
What does that mean? You can create a application which uses all required APIs and schedule the application executable using windows scheduler.
|
|
|
|
|
|
you could still use timer just store the number of minutes (or hours (or days)) elapsed by incrementing it every time the timer ticks.
i.e. if your timer interval is 60000 (60 seconds) you could increment the minute value with each tick and then process that value.
another option is you could store the scheduled time and then when the timer tick event fires every second, for example, you can check to see if the current time matches the scheduled time (or greater than). if so then do your notification code or whatever it is you plan to do.
|
|
|
|
|
The timer will be reset every time your application starts, so if your app might be closed or the computer/server that it's running on may be rebooted it's not going to work without storing the sceduled time somewhere and seeing if that has been reached/passed on restart and setting the timer accordingly.
A better approach would be to store the next scheduled time, and tick your timer every so often (how often depends on how critical the timing of 2 days needs to be) and check against the stored scheduled time in each tick.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Be a programmer and write your own timer class. It certainly isn't hard to do. I'll even help you with a starting point - the class should use a BackgroundWorker object because it can already report progress (which would be the equivalent of a timer tick.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks !! I need to get pitch into the same ...
|
|
|
|
|
satsumatable wrote: I need to get pitch into the same ...
Whatever that means...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I have a public partial class "con_param_tou : UserControl" (standard userControl)
But i want to inherit or implement a interface of a class that i build.
So i want to maintain the designer mode of standard User Control but i also want to implement or inherit one of my classes.
My class is currently declared as public interface base_param_interface (because I know that i cannot inherit multiple classes... So what I want to do is inherit UserControl and implement one of my interfaces which has a couple of public properties and 2,3 functions...
How do I do that?
Thanks in advance!
|
|
|
|
|
Just change your class definition to read
class YourClass : SomeBaseClass, ISomeInterface
{
}
Cheers,
Vıkram.
I don't suffer from insanity, I enjoy every moment of it.
|
|
|
|
|
wat is the equilent expression in c# for the below code
const int DICT_INVALID = 0;
const int DICT_WORD = 1;
const int DICT_NUMBER = 2;
const int DICT_CHARACTER = 3;
const int DICT_ALPHANUMERIC = 15;
thanks
the quieter u become more u hear
|
|
|
|
|
Same should work ?
Lets say C# code...
const int DICT_INVALID = 5;
|
|
|
|
|
I suppose that you mean "equivalent"?
If you want to convert something, you should tell what language you are converting from. I don't know any language where that code is an expression, but perhaps you didn't mean exactly that...
You can use that code in a C# program without changing anything at all. However, it might not be the best solution in C#, it looks like something that would rather use an enumeraton for.
Despite everything, the person most likely to be fooling you next is yourself.
modified on Tuesday, January 13, 2009 7:10 AM
|
|
|
|
|
That code will definitely work in C#, so long as those lines are wrapped in a class. I agree with Guffa, though, you should use an enumeration instead:
public enum Dict
{
Invalid = 0,
Word = 1,
Number = 2,
Character = 3,
Alphanumeric = 15
}
|
|
|
|
|
Is there any way to change VSS Password using C# code? Please Help!
Thanks.
|
|
|
|
|
Having looked through multiple GUI libraries like DevExpress[^], Infragistics[^] or Telerik[^], they lack one essential feature (for me!):
Look on every platform like being developed for that platform!
I.e. on Windows 2003 look like Windows 2003 grids, buttons, list, fonts, etc., on Windows XP look like a native Windows XP application, on Vista like a native Vista application, you name it.
The only library that seems to support parts of my requirement is DotNetBar[^], but unfortunately their grid supports no grouping which I would required.
Question: Are you aware of any Windows Forms GUI library that is both complete and supports native look-and-feel controls?
Thanks
Uwe
|
|
|
|
|
what is the equalent fuction in c# for scope resolution operator used in c++
the quieter u become more u hear
|
|
|
|
|
"."
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
|
|
|
|
|
Hello,
How to Invoke Upgrade Method of Win32_Product.
SelectQuery qry = new SelectQuery("Win32_Product");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(qry);
ManagementObjectCollection av = searcher.Get();
foreach (ManagementObject var in av)
{
try
{
listBox1.Items.Add(Convert.ToString(var["Name"]));
}
catch (Exception ex)
{
}
}
Please Help,
Thanks
Kiran Banker
|
|
|
|
|
hello
If remoting object is instantiated by Remoting framework on remote server, how can I pass a file handle on remote server to remote object's constructor? I am not sure if I want to do this by static variable/member.
Thanks
dev
|
|
|
|
|
hi guys,
Anyone knows how to play swf file in windows application.I tried window media player (axWindowsMediaPlayer control). .It is not working sometimes playing half only and then playing from the start.sometimes in middle goes to next swf file.My task is given below for better clarification...
I need to get duration of the SWF file.In axWindowsMediaPlayer I am getting the duration as Zero,other file type like avi,wmp,flv I am getting current duration.
There is a group of SWF file.its path I stored in an array & playing one by one.After playing all the files I need to do someother task.I also tried Shockwave flash object but dont know how to get duration ,the media end event not to loop etc....
How can I achieve this?
Is there any free third party tools available?
If give the explanation with the code I will be delighted.
Thanks in advance,
Ebin
|
|
|
|
|