Click here to Skip to main content
15,890,345 members
Home / Discussions / C#
   

C#

 
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 
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 
Thank for reply.

This is not based on web request process. This is schedule based background work. the user can update the time of the scheduling from web page.

on the application host the thread initiate the process.At beginning the thread started and waiting for that particular schedule time( which is getting from database)And that thread is waiting until that time using manualResetevent ( block the thread process using waitOne(milSec).
If comes at the particular times, the process is read the xml file and that data would be updated to database. for that xml reading

C#
XmlDocument configDoc = new XmlDocument();
             XmlNode parentNode = null;
             configDoc.Load(tConfigfilePath);
             if (null != configDoc)
             {
                   XmlNode  Id = configDoc.SelectSingleNode("/CCC/AAA");
                   // Here the value set to object. which is datamember class.
                   Id.SetValue("ZZZ", detectOid.InnerText);

             }


Then that value inserted to database. Again that waiting for next day time using below code. In between time if any changed happened on the xml file, suddenly the catch ( with in a while loop) is catch the exception.

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;
        }

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 
AnswerRe: Event Handler for button clicks Pin
Luc Pattyn15-Dec-11 5:57
sitebuilderLuc Pattyn15-Dec-11 5:57 
AnswerRe: Event Handler for button clicks Pin
BillWoodruff15-Dec-11 14:20
professionalBillWoodruff15-Dec-11 14:20 

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.