Click here to Skip to main content
13,292,723 members (68,856 online)
Rate this:
 
Please Sign up or sign in to vote.
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 7-Dec-12 20:50pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Mate end process the file in the task manager. Then restart your program
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 8 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100