Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: Process Exit problem ! Pin
Luc Pattyn14-Feb-10 23:10
sitebuilderLuc Pattyn14-Feb-10 23:10 
QuestionRe: Process Exit problem ! Pin
Nematjon Rahmanov14-Feb-10 23:32
Nematjon Rahmanov14-Feb-10 23:32 
AnswerRe: Process Exit problem ! Pin
Luc Pattyn14-Feb-10 23:43
sitebuilderLuc Pattyn14-Feb-10 23:43 
QuestionRe: Process Exit problem ! Pin
Nematjon Rahmanov15-Feb-10 0:17
Nematjon Rahmanov15-Feb-10 0:17 
AnswerRe: Process Exit problem ! Pin
Luc Pattyn15-Feb-10 0:24
sitebuilderLuc Pattyn15-Feb-10 0:24 
AnswerRe: Process Exit problem ! Pin
#realJSOP15-Feb-10 1:45
professional#realJSOP15-Feb-10 1:45 
GeneralRe: Process Exit problem ! Pin
Nematjon Rahmanov15-Feb-10 2:14
Nematjon Rahmanov15-Feb-10 2:14 
GeneralRe: Process Exit problem ! Pin
#realJSOP15-Feb-10 2:36
professional#realJSOP15-Feb-10 2:36 
OHHHHHHHHH. I thought you were trying to determine when the process ended.

You need to set up a thread that tries to open the file access set to FileShare.None. Once it doesn't throw an exception, the file's been closed. Do something like this:

bool closed = false;
do
{
    try
    {
        // try to open a file stream
        using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None))
        // if we get here, we didn't get an exception and the file is ready to be used
        closed = true;
    }
    catch (Exception ex)
    {
        if (ex != null) {}
    }
} while (!closed)


You could use a BackgroundWorker object since it can post an event when the thread has completed, and you can react to that event.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

GeneralRe: Process Exit problem ! Pin
Nematjon Rahmanov15-Feb-10 3:28
Nematjon Rahmanov15-Feb-10 3:28 
GeneralRe: Process Exit problem ! Pin
#realJSOP15-Feb-10 4:08
professional#realJSOP15-Feb-10 4:08 
GeneralRe: Process Exit problem ! Pin
Nematjon Rahmanov15-Feb-10 4:16
Nematjon Rahmanov15-Feb-10 4:16 
GeneralRe: Process Exit problem ! Pin
#realJSOP15-Feb-10 4:25
professional#realJSOP15-Feb-10 4:25 
AnswerRe: Process Exit problem ! Pin
#realJSOP15-Feb-10 0:00
professional#realJSOP15-Feb-10 0:00 
QuestionRe: Process Exit problem ! Pin
Nematjon Rahmanov15-Feb-10 0:41
Nematjon Rahmanov15-Feb-10 0:41 
AnswerRe: Process Exit problem ! Pin
#realJSOP15-Feb-10 1:28
professional#realJSOP15-Feb-10 1:28 
GeneralRe: Process Exit problem ! Pin
Nematjon Rahmanov15-Feb-10 1:39
Nematjon Rahmanov15-Feb-10 1:39 
AnswerRe: Process Exit problem ! Pin
Dave Kreskowiak15-Feb-10 5:37
mveDave Kreskowiak15-Feb-10 5:37 
QuestionOnclick event of Hyperlink Pin
muka6614-Feb-10 22:36
muka6614-Feb-10 22:36 
Questionconversion from docx to html Pin
abcurl14-Feb-10 21:35
abcurl14-Feb-10 21:35 
QuestionHow to submit just a class name as a parameter of a method? Pin
ThomasZ0114-Feb-10 20:33
ThomasZ0114-Feb-10 20:33 
AnswerRe: How to submit just a class name as a parameter of a method? Pin
AhsanS14-Feb-10 20:45
AhsanS14-Feb-10 20:45 
GeneralRe: How to submit just a class name as a parameter of a method? Pin
ThomasZ0114-Feb-10 22:11
ThomasZ0114-Feb-10 22:11 
AnswerRe: How to submit just a class name as a parameter of a method? Pin
AspDotNetDev14-Feb-10 20:46
protectorAspDotNetDev14-Feb-10 20:46 
GeneralRe: How to submit just a class name as a parameter of a method? Pin
ThomasZ0114-Feb-10 22:08
ThomasZ0114-Feb-10 22:08 
GeneralRe: How to submit just a class name as a parameter of a method? Pin
AspDotNetDev15-Feb-10 5:27
protectorAspDotNetDev15-Feb-10 5:27 

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.