here is the missing part

22/12/2004 - 11:16 por CK | Informe spam
Hi Poblacion,

Yes thats exactly what I want to do . I want the 3) process to run after 1)
and 2) complete. but I dont want to restart the service again (the whole
process works fine if i restart the service). Is there a way to put a timer
for process 3) or any other thoughts?

Thanks
here is the code for process 1) . process 2) is the same ;

private void Process1()

{

//Instantiate the Converter class

Newclass objP= new NewClass();

//Process the Files one by one

while(Directory.GetFiles(IncomingXMLPathPLength>0)

{

if(Directory.Exists(IncomingXMLPathP) && Directory.Exists(PathIntermediate))

{

//Get the File in the directory

DirectoryInfo dir = new DirectoryInfo(IncomingXMLPathP);

FileInfo[] xmlfiles = dir.GetFiles("*.xml");

Thread.Sleep(1000);

foreach( FileInfo file in xmlfiles)

{


string strH="";

string InternalTransactionID="";

//Opens an existing UTF-8 encoded text file for reading.

StreamReader sr = File.OpenText(file.FullName);

string data= sr.ReadToEnd();


strH= objP.ConvertNewCt(data,out InternalTransactionID);

FileInfo outputFile = new
FileInfo(PathIntermediate+InternalTransactionID+".clm");

StreamWriter strWriter =new StreamWriter(File.Open(PathIntermediate+
InternalTransactionID +".clm",FileMode.Create, FileAccess.Write ));

strWriter.Flush();

strWriter.Write(strHMI.ToString());


strWriter.Close();

sr.Close();

file.Delete();

}

}

}

}
 

Leer las respuestas

#1 A.Poblacion
22/12/2004 - 09:36 | Informe spam
"CK" wrote in message
news:eN0WM6$
[...]
here is the code for process 1) . process 2) is the same ;
[...]




(Replied in the original thread "Re: threading question")

Preguntas similares