The website is inexplicably faulty (we often cannot find it), so we restart the Service (Sometimes it is better to restart the machine ). Let's talk about how you restart the service in iis6.0 today. I thought it was originally operated on a graphical interface. Later I learned how to restart Net start [Stop] W3SVC, and later I learned about iisweb/start [Stop] default website, later I learned that the iisreset/noforce command can also do this, and later I learned that I can use vbs, as shown below:CodeAs shown in:
Set Webserviceobj = GetObject ( " IIS: // localhost/w3svc " )
Wamusername = Webserviceobj. wamusername
Msgbox Wamusername
Later, I knew that I could use the C # language for control (I didn't actually do it). Maybe there is another way ...... In general, there are only two situations: restarting the service and restarting the website.
Next, let's take a look at the relationship between websites and services. Services are the foundation for website operation. The World Wide Web Publishing Service can run multiple websites, if the World Wide Web Publishing Service is stopped, all websites and ApplicationsProgramThe pool is stopped. For example:
Otherwise, if you manually stop the website or application pool, the World Wide Web Hing service will not be affected. From this simple relationship, we can conclude that a website may encounter problems that are not necessarily service problems, most of the time there is a problem with the program of this website (of course there are cases where a program error is too severe to cause the service to stop), so it is not necessary to restart the service, just restart the website program. Website data (memory data such as cache or static variables instead of database data) may be disordered and may need to be reloaded, at this time, you only need to restart the application pool corresponding to the website. What command can be used to restart the application pool (of course, through the graphic interface )? Currently, I have found only one way to implement vbs, as shown in the following code:
Set Webapppool = GetObject ( " IIS: // localhost/w3svc/apppools/defaultapppool " )
Webapppool. Stop
Webapppool. Start
End: If you have a better solution, please do not reply ,.