Click here to Skip to main content
15,888,401 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# help? Pin
gymmy15-Dec-11 12:31
gymmy15-Dec-11 12:31 
AnswerRe: C# help? Pin
DaveyM6915-Dec-11 13:18
professionalDaveyM6915-Dec-11 13:18 
QuestionC# question? Pin
Brian Reiber15-Dec-11 5:14
Brian Reiber15-Dec-11 5:14 
AnswerRe: C# question? Pin
DaveyM6915-Dec-11 5:32
professionalDaveyM6915-Dec-11 5:32 
AnswerRe: C# question? PinPopular
Pete O'Hanlon15-Dec-11 5:37
mvePete O'Hanlon15-Dec-11 5:37 
GeneralRe: C# question? Pin
harold aptroot15-Dec-11 6:22
harold aptroot15-Dec-11 6:22 
QuestionWindows 7: Automatic file delete? Pin
Paladin200015-Dec-11 4:52
Paladin200015-Dec-11 4:52 
QuestionThread Abort Exception Pin
anishkannan15-Dec-11 0:27
anishkannan15-Dec-11 0:27 
<System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.WaitHandle.WaitOneNative(SafeWaitHandle waitHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at System.Threading.WaitHandle.WaitOne(Int64 timeout, Boolean exitContext) at System.Threading.WaitHandle.WaitOne(TimeSpan timeout, Boolean exitContext) at System.Threading.WaitHandle.WaitOne(TimeSpan timeout) >


Exception like this.

The web application, here on clicks, singleton object creates separate thread then that thread read a data read from xml file. using XMLDocument.
then after read that file data updated to database, then waiting for another request for that, with in the thread ManuelResetEvent wait is performed, if comes next request from while onlick button its Ret and release the thread block and doing that same process.

as per requirement,In between if needs, can change xml value dynamically, but when i edit that xml and saving, the thread was aborting automatically then entire application crashed.

code is


C#
private void XMlreaderProcess()
     {
        long delayTimeSpanTicks = 0;

         try
         {
             while (Active)
             {
                 try
                 {
                     triggerCtrl.Reset();
                     

                     if (delayTimeSpanTicks == 0)
                     {
                          triggerCtrl.WaitOne();
                     }
                     else
                     {
                          triggerCtrl.WaitOne(new TimeSpan(delayTimeSpanTicks));
                     }

                     
                            StartProcess();
 
                 }
                 catch(Exception ex)
                 {
                     delayTimeSpanTicks = 0;
                     

                 }
                 finally
                 {
                     
                 }
             }
         }
         catch(Exception ex)
         {
             
         }
         finally
         {
             Active= false;
        }

AnswerRe: Thread Abort Exception Pin
BobJanova15-Dec-11 22:32
BobJanova15-Dec-11 22:32 
GeneralRe: Thread Abort Exception Pin
anishkannan15-Dec-11 22:54
anishkannan15-Dec-11 22:54 
QuestionCreate a licence file. Pin
Jitendra Parida - Jeetu15-Dec-11 0:03
Jitendra Parida - Jeetu15-Dec-11 0:03 
QuestionReplace File Only If Newer (Deployment) Pin
PDaniels3314-Dec-11 23:28
PDaniels3314-Dec-11 23:28 
AnswerRe: Replace File Only If Newer (Deployment) Pin
Not Active15-Dec-11 0:25
mentorNot Active15-Dec-11 0:25 
QuestionHow to find coordinates of each word in pdf file using iTextSharp Pin
NarVish14-Dec-11 23:18
NarVish14-Dec-11 23:18 
QuestionMake a sql query object by C#. Pin
Vincet Shen14-Dec-11 17:05
Vincet Shen14-Dec-11 17:05 
AnswerRe: Make a sql query object by C#. Pin
OriginalGriff14-Dec-11 21:35
mveOriginalGriff14-Dec-11 21:35 
GeneralRe: Make a sql query object by C#. Pin
Vincet Shen15-Dec-11 22:11
Vincet Shen15-Dec-11 22:11 
QuestionEvent Handler for button clicks Pin
Miwin Solutions14-Dec-11 7:43
Miwin Solutions14-Dec-11 7:43 
AnswerRe: Event Handler for button clicks Pin
Luc Pattyn14-Dec-11 8:28
sitebuilderLuc Pattyn14-Dec-11 8:28 
GeneralRe: Event Handler for button clicks Pin
Miwin Solutions14-Dec-11 9:24
Miwin Solutions14-Dec-11 9:24 
GeneralRe: Event Handler for button clicks Pin
Miwin Solutions14-Dec-11 22:46
Miwin Solutions14-Dec-11 22:46 
GeneralRe: Event Handler for button clicks Pin
Luc Pattyn14-Dec-11 23:41
sitebuilderLuc Pattyn14-Dec-11 23:41 
AnswerRe: Event Handler for button clicks Pin
BillWoodruff14-Dec-11 21:42
professionalBillWoodruff14-Dec-11 21:42 
GeneralRe: Event Handler for button clicks Pin
Miwin Solutions14-Dec-11 22:49
Miwin Solutions14-Dec-11 22:49 
GeneralRe: Event Handler for button clicks Pin
SilimSayo15-Dec-11 4:05
SilimSayo15-Dec-11 4:05 

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.