Click here to Skip to main content
15,886,578 members
Home / Discussions / C#
   

C#

 
QuestionCapturing screenshots from games Pin
SimpleData29-Jul-09 1:55
SimpleData29-Jul-09 1:55 
AnswerRe: Capturing screenshots from games Pin
leckey29-Jul-09 4:59
leckey29-Jul-09 4:59 
GeneralRe: Capturing screenshots from games Pin
SimpleData29-Jul-09 5:13
SimpleData29-Jul-09 5:13 
GeneralRe: Capturing screenshots from games Pin
leckey29-Jul-09 7:16
leckey29-Jul-09 7:16 
GeneralRe: Capturing screenshots from games Pin
SimpleData29-Jul-09 7:25
SimpleData29-Jul-09 7:25 
GeneralRe: Capturing screenshots from games Pin
leckey29-Jul-09 14:23
leckey29-Jul-09 14:23 
GeneralRe: Capturing screenshots from games Pin
SimpleData29-Jul-09 23:26
SimpleData29-Jul-09 23:26 
QuestionTimer interval not change while running the windows service in C# Pin
Rajesh_K_Sharma29-Jul-09 1:17
Rajesh_K_Sharma29-Jul-09 1:17 
Hi
I made a window service application and I used system.timers.timer class . I set timer interval from config file. I would like to fire timer as specified interval in config file. It works fine but while running the windows service I want to change timer interval in config file and timer should be fired at latest interval . When I stop the service and restart the service then timer fire as specified value in config file.

Pseudo code

private System.Timers.Timer timer2 = new System.Timers.Timer();
protected override void OnStart(string[] args)
{
// dblValue = 30000
double dblValue = Convert.ToDouble(ConfigurationManager.AppSettings.Get("Interval"));

timer2.interval = dblValue
timer2.Elapsed += new System.Timers.ElapsedEventHandler(timer2_Elapsed);
timer2.Enabled = true;

}
void timer2_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
timer2.Enabled = false;
// doing some operation



// Now I want to change the value in config file like dblValue = 60000

double dblValue = Convert.ToDouble(ConfigurationManager.AppSettings.Get("Interval"));
timer2.interval = dblValue

timer2.Enabled = true;
}

but timer always fired after 30000 milliseconds. But I want , timer should be fired after 60000 milliseconds , means latest value define in config file. Please tell me how to do this ?


Regards
Rajesh

rajesh

AnswerRe: Timer interval not change while running the windows service in C# Pin
Ashfield29-Jul-09 1:28
Ashfield29-Jul-09 1:28 
AnswerRe: Timer interval not change while running the windows service in C# Pin
PIEBALDconsult29-Jul-09 5:00
mvePIEBALDconsult29-Jul-09 5:00 
GeneralRe: Timer interval not change while running the windows service in C# Pin
Rajesh_K_Sharma29-Jul-09 23:29
Rajesh_K_Sharma29-Jul-09 23:29 
Questionset a font for a TextBox / c# [modified] Pin
made in 4429-Jul-09 1:13
made in 4429-Jul-09 1:13 
AnswerRe: set a font for a TextBox / c# Pin
stancrm29-Jul-09 1:38
stancrm29-Jul-09 1:38 
GeneralRe: set a font for a TextBox / c# Pin
made in 4430-Jul-09 3:03
made in 4430-Jul-09 3:03 
GeneralRe: set a font for a TextBox / c# Pin
stancrm30-Jul-09 3:14
stancrm30-Jul-09 3:14 
GeneralRe: set a font for a TextBox / c# Pin
made in 4430-Jul-09 6:25
made in 4430-Jul-09 6:25 
AnswerRe: set a font for a TextBox / c# Pin
Baeltazor30-Jul-09 19:00
Baeltazor30-Jul-09 19:00 
QuestionAccess Methods of a Class Directly Pin
Matt Clarkson29-Jul-09 1:00
Matt Clarkson29-Jul-09 1:00 
AnswerRe: Access Methods of a Class Directly Pin
stancrm29-Jul-09 1:02
stancrm29-Jul-09 1:02 
GeneralRe: Access Methods of a Class Directly Pin
Matt Clarkson29-Jul-09 1:05
Matt Clarkson29-Jul-09 1:05 
AnswerRe: Access Methods of a Class Directly Pin
Nagy Vilmos29-Jul-09 2:19
professionalNagy Vilmos29-Jul-09 2:19 
QuestionHow to Develop Serverless LAN chatting software? Pin
Abdullah_Hunzai28-Jul-09 23:41
Abdullah_Hunzai28-Jul-09 23:41 
AnswerRe: How to Develop Serverless LAN chatting software? Pin
dan!sh 29-Jul-09 0:42
professional dan!sh 29-Jul-09 0:42 
GeneralRe: How to Develop Serverless LAN chatting software? Pin
Abdullah_Hunzai30-Jul-09 20:18
Abdullah_Hunzai30-Jul-09 20:18 
QuestionReading a selected value from a dropdownlist nested inside the Datagridview Pin
Seabata28-Jul-09 23:10
Seabata28-Jul-09 23:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.