Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
GeneralRe: Collection within a Collection and "loading" advice Pin
Jon Rista23-Oct-02 18:33
Jon Rista23-Oct-02 18:33 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 21:19
sitebuilderPaul Watson23-Oct-02 21:19 
GeneralRe: Collection within a Collection and "loading" advice Pin
Jon Rista27-Oct-02 17:48
Jon Rista27-Oct-02 17:48 
Questionthread.Abort() doesn't work????? Pin
fftongzhi22-Oct-02 15:23
fftongzhi22-Oct-02 15:23 
AnswerRe: thread.Abort() doesn't work????? Pin
Paul Riley23-Oct-02 0:17
Paul Riley23-Oct-02 0:17 
GeneralRe: thread.Abort() doesn't work????? Pin
James T. Johnson23-Oct-02 0:58
James T. Johnson23-Oct-02 0:58 
GeneralRe: thread.Abort() doesn't work????? Pin
fftongzhi23-Oct-02 16:04
fftongzhi23-Oct-02 16:04 
GeneralRe: thread.Abort() doesn't work????? Pin
James T. Johnson23-Oct-02 16:57
James T. Johnson23-Oct-02 16:57 
This code works for me

save as ThreadAbort.cs, compile with csc /out:ThreadAbort.exe /target:exe ThreadAbort.cs

Even better, if you have VS.NET you can watch the output window and it will tell you when the thread has exited.

using System;
using System.Threading;
 
namespace ThreadAbort
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
			Thread f = new Thread(new ThreadStart(Run));
			f.Start();
			Thread.Sleep(1500);
			f.Abort();
 
			Console.ReadLine();
		}
 
		static void Run()
		{
			while(true)
			{
				Console.WriteLine("thread will sleep");
				System.Threading.Thread.Sleep(2000);
				Console.WriteLine("thread is awake");
			}
		}
	}
}


James
Sig code stolen from David Wulff

GeneralRe: thread.Abort() doesn't work????? Pin
fftongzhi23-Oct-02 18:51
fftongzhi23-Oct-02 18:51 
GeneralRe: thread.Abort() doesn't work????? Pin
Jon Rista23-Oct-02 17:51
Jon Rista23-Oct-02 17:51 
GeneralRe: thread.Abort() doesn't work????? Pin
James T. Johnson23-Oct-02 18:39
James T. Johnson23-Oct-02 18:39 
GeneralHelp about .NET windows service solutions Pin
Member 13227322-Oct-02 5:07
Member 13227322-Oct-02 5:07 
Questionplease try it...see what happens...is it a bug? Pin
Atilla Selem22-Oct-02 4:36
Atilla Selem22-Oct-02 4:36 
AnswerRe: please try it...see what happens...is it a bug? Pin
Daniel Turini22-Oct-02 4:43
Daniel Turini22-Oct-02 4:43 
GeneralRe: please try it...see what happens...is it a bug? Pin
Atilla Selem22-Oct-02 5:51
Atilla Selem22-Oct-02 5:51 
Generalcoding conventions.... Pin
waleed riaz21-Oct-02 22:18
waleed riaz21-Oct-02 22:18 
GeneralRe: coding conventions.... Pin
Stephane Rodriguez.21-Oct-02 22:28
Stephane Rodriguez.21-Oct-02 22:28 
GeneralRe: coding conventions.... Pin
Daniel Turini21-Oct-02 22:30
Daniel Turini21-Oct-02 22:30 
GeneralRe: coding conventions.... Pin
waleed riaz22-Oct-02 9:35
waleed riaz22-Oct-02 9:35 
GeneralRe: coding conventions.... Pin
Daniel Turini22-Oct-02 10:02
Daniel Turini22-Oct-02 10:02 
GeneralRe: coding conventions.... Pin
waleed riaz22-Oct-02 21:52
waleed riaz22-Oct-02 21:52 
GeneralRe: coding conventions.... Pin
Kevin McFarlane24-Oct-02 7:33
Kevin McFarlane24-Oct-02 7:33 
GeneralRe: coding conventions.... Pin
waleed riaz24-Oct-02 19:04
waleed riaz24-Oct-02 19:04 
GeneralRe: coding conventions.... Pin
Kevin McFarlane25-Oct-02 0:07
Kevin McFarlane25-Oct-02 0:07 
GeneralRe: coding conventions.... Pin
Furty25-Oct-02 15:39
Furty25-Oct-02 15:39 

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.