Click here to Skip to main content
15,922,007 members
Home / Discussions / C#
   

C#

 
QuestionProcess.Start() mailto exception - default mail client Pin
stretchtack19-Jun-06 13:11
stretchtack19-Jun-06 13:11 
AnswerRe: Process.Start() mailto exception - default mail client Pin
Alexander Wiseman19-Jun-06 13:54
Alexander Wiseman19-Jun-06 13:54 
GeneralRe: Process.Start() mailto exception - default mail client Pin
stretchtack19-Jun-06 19:20
stretchtack19-Jun-06 19:20 
GeneralSTAThread vs. MTAThread - Process.Start() Pin
stretchtack20-Jun-06 7:28
stretchtack20-Jun-06 7:28 
GeneralRe: STAThread vs. MTAThread - Process.Start() Pin
Alexander Wiseman20-Jun-06 8:46
Alexander Wiseman20-Jun-06 8:46 
QuestionSession State Transfer Pin
Expert Coming19-Jun-06 11:39
Expert Coming19-Jun-06 11:39 
QuestionNeural networks in c# Pin
yasar khan19-Jun-06 10:46
yasar khan19-Jun-06 10:46 
AnswerRe: Neural networks in c# Pin
Colin Angus Mackay19-Jun-06 11:13
Colin Angus Mackay19-Jun-06 11:13 
AnswerRe: Neural networks in c# Pin
Ravi Bhavnani19-Jun-06 11:39
professionalRavi Bhavnani19-Jun-06 11:39 
AnswerRe: Neural networks in c# Pin
User 171649219-Jun-06 13:29
professionalUser 171649219-Jun-06 13:29 
Questionexecting .bat file. Pin
tom laz19-Jun-06 10:29
tom laz19-Jun-06 10:29 
AnswerRe: execting .bat file. Pin
Ed.Poore19-Jun-06 10:33
Ed.Poore19-Jun-06 10:33 
AnswerRe: execting .bat file. Pin
Joshua Lunsford19-Jun-06 10:33
Joshua Lunsford19-Jun-06 10:33 
AnswerRe: execting .bat file. Pin
Spike^Blue^Heaven19-Jun-06 20:13
Spike^Blue^Heaven19-Jun-06 20:13 
GeneralRe: execting .bat file. Pin
tom laz19-Jun-06 10:46
tom laz19-Jun-06 10:46 
GeneralRe: execting .bat file. Pin
tom laz19-Jun-06 10:49
tom laz19-Jun-06 10:49 
GeneralRe: execting .bat file. Pin
Joshua Lunsford19-Jun-06 11:28
Joshua Lunsford19-Jun-06 11:28 
QuestionWindows Service with threading issues Pin
Joshua Lunsford19-Jun-06 10:26
Joshua Lunsford19-Jun-06 10:26 
I have an issue with stopping threads in a windows service application I was wondering if anyone can help. let me set it up for you. In a windows service you have to use the OnStart method to initialize your application... but you cannot run any loops or sequence of events that contain loops or the state of the application will be in an "starting" service mode indefinitely. So I start a thread call Maint to handle the application. The application has threee main functions at the moment that interface with WAN file shares and a sql db. I run these parallel each in there own thread(and they dont interact with eachother). so in the OnStart method:

maint Maint = new maint();<br />
maintThread = new Thread(new ThreadStart(Maint.start));<br />
maintThread.Start();

in that start method i call:

importassets ia = new importassets();<br />
importThread = new Thread(new ThreadStart(ia.importasset));<br />
importThread.Start();<br />
<br />
updatereg ur = new updatereg();<br />
updateThread = new Thread(new ThreadStart(ur.runupdate));<br />
updateThread.Start();<br />
<br />
forcelogins fl = new forcelogins();<br />
loginThread = new Thread(new ThreadStart(fl.runlogins));<br />
loginThread.Start();<br />
<br />
//This section forces the importThread to restart hourly<br />
int startTime = System.Environment.TickCount; <br />
int runTime = startTime+3600000;<br />
while(true)<br />
{<br />
	int nowTime = System.Environment.TickCount;<br />
	FAISservice fs = new FAISservice();<br />
	if(!fs.isRunning)<br />
		break;<br />
	if(runTime < nowTime)<br />
	{<br />
		importThread.Abort();<br />
		Thread.Sleep(3000);<br />
		startImport();<br />
		runTime = nowTime+3600000;<br />
	}<br />
	Thread.Sleep(10000);<br />
<br />
}


Now, all works fine until the OnStop() method gets called by the service being stopped or restarted. in the OnStop() method i run:

isRunning = false;<br />
<br />
maintThread.Abort();<br />
<br />
maint Maint = new maint();<br />
Maint.stop();


and in the stop() method i call:
importThread.Abort();<br />
			updateThread.Abort();<br />
			loginThread.Abort();


Now I'm locked in a "STOPPING" state and i have to kill the process... any clues? also... my above 3 threads start while(true) loops that only BREAK when isRunning=false.
AnswerRe: Windows Service with threading issues Pin
Tom Delany19-Jun-06 11:47
Tom Delany19-Jun-06 11:47 
QuestionPageSize not working on PagedDataSource populated by an ArrayList Pin
Afut19-Jun-06 9:07
Afut19-Jun-06 9:07 
QuestionNeural networks in c# Pin
yasar khan19-Jun-06 8:35
yasar khan19-Jun-06 8:35 
AnswerRe: Neural networks in c# Pin
Josh Smith19-Jun-06 9:58
Josh Smith19-Jun-06 9:58 
Question.NET 2.0 properties and Javascript Pin
Marc Clifton19-Jun-06 7:59
mvaMarc Clifton19-Jun-06 7:59 
AnswerRe: .NET 2.0 properties and Javascript Pin
Marc Clifton19-Jun-06 9:25
mvaMarc Clifton19-Jun-06 9:25 
QuestionCombo Box and refresh/reload data Pin
Saamir19-Jun-06 7:45
Saamir19-Jun-06 7:45 

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.