Programmatic Site "Reset"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. Is there a way to make a call in ASP.NET that will effectively do exactly
the same thing is when you "touch"/change the web.config file? In other
words, I want to be able to programmatically cause the same kind of general
resetting that happens when you touch the web.config file.

Alex
 
That's a great tip, Peter...

For VB fans...here's the equivalent VB.NET code :

Private Sub KillAspNetProcess()
Dim processName As String = "aspnet_wp"
Dim os As System.OperatingSystem = System.Environment.OSVersion
'Longhorn and Windows Server 2003 use w3wp.exe
If (((os.Version.Major = 5) AndAlso (os.Version.Minor > 1)) OrElse (os.Version.Major = 6)) Then
processName = "w3wp"
End If
For Each process As Process In Process.GetProcessesByName(processName)
Response.Write(("Killing ASP.NET worker process (Process ID:" + (process.Id + ")")))
process.Kill
Next
End Sub




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top