Click here to Skip to main content
15,921,548 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
I wanted to run an external application from .net so i wrote it .
Dim p As System.Diagnostics.Process =     System.Diagnostics.Process.Start(Address)
Thread.Sleep(55000)
If p.HasExited = False Then
    p.Kill()
End If

and it worked well actually. But when the electricity goes off my server will not stop the instance of the application
and after starting up the server wants to run the application but here it gives me th error . "the file Is being Used by another application"
I tried to close the file with this code
If File.Exists(Address) Then
    File .Delete( AddressFile)
End If


but it again gives me the same error
what should i do ?
Posted

1 solution

Mate end process the file in the task manager. Then restart your program
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900