Click here to Skip to main content
15,907,913 members
Home / Discussions / C#
   

C#

 
QuestionDatagrid location on print page Pin
spankyleo12312-Aug-09 22:18
spankyleo12312-Aug-09 22:18 
AnswerRe: Datagrid location on print page Pin
Henry Minute13-Aug-09 3:43
Henry Minute13-Aug-09 3:43 
QuestionAbort or Stop Thread using c# Pin
Abdul Rahman Hamidy12-Aug-09 21:36
Abdul Rahman Hamidy12-Aug-09 21:36 
AnswerRe: Abort or Stop Thread using c# Pin
stancrm12-Aug-09 21:49
stancrm12-Aug-09 21:49 
GeneralRe: Abort or Stop Thread using c# Pin
OriginalGriff12-Aug-09 21:50
mveOriginalGriff12-Aug-09 21:50 
GeneralRe: Abort or Stop Thread using c# Pin
Abdul Rahman Hamidy12-Aug-09 22:02
Abdul Rahman Hamidy12-Aug-09 22:02 
GeneralRe: Abort or Stop Thread using c# Pin
stancrm12-Aug-09 22:56
stancrm12-Aug-09 22:56 
GeneralRe: Abort or Stop Thread using c# Pin
Abdul Rahman Hamidy13-Aug-09 0:18
Abdul Rahman Hamidy13-Aug-09 0:18 
well, i think u guys did not understand me correctly, bellow is the complete code only for "pdfDownloadStart"
void StartStructureTimer(int time)
		{
			timStructure=new System.Threading.Timer(new TimerCallback(TimerStructureJob));
			timStructure.Change(time,0);
		}
		void TimerStructureJob(object state)
		{
			System.Threading.Timer tm=state as System.Threading.Timer;
			tm.Dispose();
			pdfDownloadStart();
		}
		void pdfDownloadStart()
		{
			try
			{
				signalMessage(string.Format("Searching Server {0} for newly added Files",fdo.FtpServer));
				dtList=p.getPdfNotDownloaded();
				if (dtList.Rows.Count>0)
				{
					signalMessage(string.Format("{0} Files Found for Download",dtList.Rows.Count));
					fdo.FilesToDownloadList=dtList;
					fdo.LocalDownloadDirectory=TempDirectory;
					Thread tPdf=new Thread(new ThreadStart(downloadFile));
					tPdf.Start();
					tPdf.Join();
					if (!fdo.DownloadStatus)
					{
						if (timDownload!=null)
							timDownload.Dispose();
						signalMessage("Download Failed\r\nretrying in 60 second");
						StartTimer(36000);
					}
					else if (fdo.DownloadStatus)
					{
						if (timDownload!=null)
							timDownload.Dispose();
						signalMessage("All Files Downloaded Successfully\r\nretrying in 60 second");
						StartTimer(36000); //when downloading finished then start again in 60 second
						return;
					}
					else
						StartTimer(36000); // 60 second
				}
				else
				{
					signalMessage("No Files Found\r\nretrying in 60 second");
					StartTimer(36000);
				}
			}
			catch(Exception ex)
			{
				if (!pdfStopped)
				{
					signalMessage("Failed downloading Files from Remote Server "+ex.Message+"\r\nretrying in 60 second");
					StartTimer(36000);
				}
				else
					signalMessage("Failed downloading Files from Remote Server "+ex.Message);
			}
		}

all methods which runs on those thread has the same functionality. if u see after "60 second" process runs agains.
if i abort or stop the thread still the job runs after 60 seconds.
if u see closly another thread is running to download the files, well i want to stop all these threads, if i use bool value like that still the scheduled process runs.
how can i stop all these threads from calling thread to end?

Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan

GeneralRe: Abort or Stop Thread using c# Pin
stancrm13-Aug-09 1:33
stancrm13-Aug-09 1:33 
AnswerRe: Abort or Stop Thread using c# Pin
OriginalGriff12-Aug-09 21:49
mveOriginalGriff12-Aug-09 21:49 
AnswerRe: Abort or Stop Thread using c# Pin
0x3c012-Aug-09 22:57
0x3c012-Aug-09 22:57 
QuestionCustom Event and Cross-thread operation not valid Question Pin
Programm3r12-Aug-09 21:22
Programm3r12-Aug-09 21:22 
AnswerRe: Custom Event and Cross-thread operation not valid Question Pin
N a v a n e e t h13-Aug-09 1:25
N a v a n e e t h13-Aug-09 1:25 
QuestionRe: Custom Event and Cross-thread operation not valid Question Pin
Programm3r13-Aug-09 1:35
Programm3r13-Aug-09 1:35 
Questioninvoking events of a control under another control Pin
jamesjk12-Aug-09 20:27
jamesjk12-Aug-09 20:27 
AnswerRe: invoking events of a control under another control Pin
Eslam Afifi12-Aug-09 21:34
Eslam Afifi12-Aug-09 21:34 
GeneralRe: invoking events of a control under another control Pin
jamesjk13-Aug-09 0:02
jamesjk13-Aug-09 0:02 
GeneralRe: invoking events of a control under another control Pin
Eslam Afifi13-Aug-09 18:05
Eslam Afifi13-Aug-09 18:05 
GeneralRe: invoking events of a control under another control Pin
jamesjk13-Aug-09 22:05
jamesjk13-Aug-09 22:05 
GeneralRe: invoking events of a control under another control Pin
Eslam Afifi14-Aug-09 2:58
Eslam Afifi14-Aug-09 2:58 
AnswerRe: invoking events of a control under another control Pin
kb-boxer13-Aug-09 1:00
kb-boxer13-Aug-09 1:00 
Generalinvoking events of a control under another control Pin
jamesjk13-Aug-09 1:15
jamesjk13-Aug-09 1:15 
Questioninvoking events of a control under another control -- i shall make it clearer Pin
jamesjk13-Aug-09 1:16
jamesjk13-Aug-09 1:16 
QuestionAdding Dll reference problem........ Pin
shaina223112-Aug-09 20:06
shaina223112-Aug-09 20:06 
AnswerRe: Adding Dll reference problem........ Pin
Eslam Afifi12-Aug-09 21:01
Eslam Afifi12-Aug-09 21:01 

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.