Click here to Skip to main content
15,902,189 members
Home / Discussions / C#
   

C#

 
GeneralRe: .NET Framework version issue Pin
Ruchi Gupta7-Apr-04 5:53
Ruchi Gupta7-Apr-04 5:53 
GeneralRe: .NET Framework version issue Pin
Heath Stewart7-Apr-04 6:54
protectorHeath Stewart7-Apr-04 6:54 
GeneralRSS Aggregator Pin
mil_an6-Apr-04 12:22
mil_an6-Apr-04 12:22 
GeneralRe: RSS Aggregator Pin
Heath Stewart6-Apr-04 12:32
protectorHeath Stewart6-Apr-04 12:32 
GeneralRe: RSS Aggregator Pin
mil_an6-Apr-04 12:48
mil_an6-Apr-04 12:48 
GeneralRe: RSS Aggregator Pin
Heath Stewart6-Apr-04 13:16
protectorHeath Stewart6-Apr-04 13:16 
GeneralRe: RSS Aggregator Pin
mil_an6-Apr-04 13:17
mil_an6-Apr-04 13:17 
Generalusing try,catch exceptions in a thread timer Pin
User 9625786-Apr-04 12:02
User 9625786-Apr-04 12:02 
Im having a lil problem with some code. I think it would be better to explain it then post it. Im using a thread timer to run a blaock of code that checks if the computer is online using try catch statements. It run good when online but when i go offline it runs some code (catch statement) but doesnt keep checking if online, as in the thread timer stops when the exemption is thrown. Is there a way to have the program keep checking if its back online, without forever loops (which didnt work out right, still learning C#)

Outline:

thread.Timer(timerCallBack( ON_TIMED_EVENT )) //every 60 sec

ON_TIMED_EVENT
{
try
{
check if online
IPHostEntry hostInfo = Dns.GetHostByNam
}
catch Exception
{
code when not online
}
}

I want it to keep checking instead of just stoping the
Thread Timer


Jason

modified 16-May-21 21:01pm.

GeneralRe: using try,catch exceptions in a thread timer Pin
Heath Stewart6-Apr-04 12:29
protectorHeath Stewart6-Apr-04 12:29 
GeneralRe: using try,catch exceptions in a thread timer Pin
User 9625786-Apr-04 15:27
User 9625786-Apr-04 15:27 
GeneralRe: using try,catch exceptions in a thread timer Pin
Roman Rodov6-Apr-04 17:14
Roman Rodov6-Apr-04 17:14 
GeneralRe: using try,catch exceptions in a thread timer Pin
User 9625786-Apr-04 19:48
User 9625786-Apr-04 19:48 
GeneralRe: using try,catch exceptions in a thread timer Pin
User 9625786-Apr-04 19:52
User 9625786-Apr-04 19:52 
GeneralRe: using try,catch exceptions in a thread timer Pin
Heath Stewart7-Apr-04 3:08
protectorHeath Stewart7-Apr-04 3:08 
GeneralRe: using try,catch exceptions in a thread timer Pin
User 9625787-Apr-04 6:56
User 9625787-Apr-04 6:56 
GeneralListView with GroupView enabled and thousands of items Pin
georgestrajan6-Apr-04 11:58
georgestrajan6-Apr-04 11:58 
GeneralRe: ListView with GroupView enabled and thousands of items Pin
Heath Stewart6-Apr-04 12:27
protectorHeath Stewart6-Apr-04 12:27 
GeneralRe: ListView with GroupView enabled and thousands of items Pin
georgestrajan7-Apr-04 17:56
georgestrajan7-Apr-04 17:56 
GeneralRe: ListView with GroupView enabled and thousands of items Pin
Heath Stewart7-Apr-04 18:02
protectorHeath Stewart7-Apr-04 18:02 
GeneralCompare two dates. Pin
kornstyle6-Apr-04 11:34
kornstyle6-Apr-04 11:34 
GeneralRe: Compare two dates. Pin
Heath Stewart6-Apr-04 12:21
protectorHeath Stewart6-Apr-04 12:21 
GeneralRe: Compare two dates. Pin
sreejith ss nair6-Apr-04 20:36
sreejith ss nair6-Apr-04 20:36 
GeneralMessage Removed Pin
6-Apr-04 11:23
wibblewibblewibble6-Apr-04 11:23 
GeneralRe: double [] via tcp/ip Pin
Heath Stewart6-Apr-04 12:19
protectorHeath Stewart6-Apr-04 12:19 
GeneralEncapsulating properties as nested class Pin
Enrico Angkawijaya6-Apr-04 11:16
Enrico Angkawijaya6-Apr-04 11:16 

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.