Click here to Skip to main content
15,921,841 members
Home / Discussions / C#
   

C#

 
GeneralRe: Connect to database via web service Pin
HenrydeSousa29-May-08 4:20
HenrydeSousa29-May-08 4:20 
QuestionWhat is the Error Pin
ASysSolvers28-May-08 4:33
ASysSolvers28-May-08 4:33 
AnswerRe: What is the Error Pin
leppie28-May-08 6:39
leppie28-May-08 6:39 
GeneralRe: What is the Error Pin
Guffa28-May-08 8:31
Guffa28-May-08 8:31 
QuestionOpenFileDialog in Web... Pin
Chetan Ranpariya28-May-08 3:59
Chetan Ranpariya28-May-08 3:59 
AnswerRe: OpenFileDialog in Web... Pin
leppie28-May-08 4:01
leppie28-May-08 4:01 
AnswerRe: OpenFileDialog in Web... Pin
Mike Dimmick28-May-08 4:30
Mike Dimmick28-May-08 4:30 
QuestionTransferring data from Excel Sheet to SQL Server 2000 database Pin
Dextter28-May-08 3:47
Dextter28-May-08 3:47 
AnswerRe: Transferring data from Excel Sheet to SQL Server 2000 database Pin
Bijesh28-May-08 3:57
Bijesh28-May-08 3:57 
QuestionFunction for Converting Plural into Singular Pin
KBM7328-May-08 3:43
KBM7328-May-08 3:43 
AnswerRe: Function for Converting Plural into Singular Pin
leppie28-May-08 3:56
leppie28-May-08 3:56 
GeneralRe: Function for Converting Plural into Singular Pin
led mike28-May-08 4:29
led mike28-May-08 4:29 
AnswerRe: Function for Converting Plural into Singular Pin
Old Nic3-May-10 4:39
Old Nic3-May-10 4:39 
Questionhow to create dynamic gridview Pin
shaek28-May-08 3:42
shaek28-May-08 3:42 
AnswerRe: how to create dynamic gridview Pin
leppie28-May-08 3:58
leppie28-May-08 3:58 
QuestionTimer Change question.. Pin
ptr2void28-May-08 3:34
ptr2void28-May-08 3:34 
AnswerRe: Timer Change question.. [modified] Pin
leppie28-May-08 3:39
leppie28-May-08 3:39 
AnswerRe: Timer Change question.. Pin
Mike Dimmick28-May-08 4:56
Mike Dimmick28-May-08 4:56 
Use of System.Threading.Timer requires a lot of thought because the callbacks always occur on the thread pool. This means they almost always fire on a different thread to the one that created the timer, that they can run concurrently if the callback function takes a long time to execute, and conversely can be blocked indefinitely if the thread pool is busy.

It is generally much safer to use a System.Windows.Forms.Timer, as long as you're running a message loop (Application.Run) on the thread. This causes the callback to be fired on the thread that created the timer when no other message is outstanding after the timer duration has passed. (This class maps directly to the operating system's SetTimer call.)

When you're debugging, you're typically stepping through code much more slowly than once a second, so the timer could well be firing another callback while you're still debugging it. You need to ensure that this isn't what you're seeing.

I can't see a problem with using GetProcesses, except to note that there's also a GetProcessesByName method which could simplify your code a bit. (Internally, this method calls GetProcesses, though, and copies the matches to an ArrayList and then to another array, so it actually produces more garbage.)


DoEvents: Generating unexpected recursion since 1991

QuestionFile IO Permissions Pin
Lisa Zapson28-May-08 3:18
Lisa Zapson28-May-08 3:18 
AnswerRe: File IO Permissions Pin
leppie28-May-08 3:34
leppie28-May-08 3:34 
GeneralRe: File IO Permissions Pin
Lisa Zapson28-May-08 3:47
Lisa Zapson28-May-08 3:47 
GeneralRe: File IO Permissions Pin
leppie28-May-08 4:00
leppie28-May-08 4:00 
GeneralRe: File IO Permissions Pin
Lisa Zapson28-May-08 4:50
Lisa Zapson28-May-08 4:50 
GeneralRe: File IO Permissions Pin
leppie28-May-08 6:37
leppie28-May-08 6:37 
GeneralRe: File IO Permissions Pin
Lisa Zapson28-May-08 8:20
Lisa Zapson28-May-08 8:20 

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.