1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Try
Dim defaultWebSite As String = "IIS://localhost/W3SVC"
Dim vRoot As DirectoryEntry = New DirectoryEntry(defaultWebSite)
For Each elem As DirectoryEntry In vRoot.Children
If Integer.TryParse(elem.Name, Nothing) Then
Dim website As DirectoryEntry = New DirectoryEntry(defaultWebSite + "/" + elem.Name + "/ROOT")
Dim path As String = website.Properties("Path")(0)
Dim myHttpWebRequest As Net.HttpWebRequest = Nothing
Dim myHttpWebResponse As Net.HttpWebResponse = Nothing
Console.WriteLine("Début de la pré-compilation du site http://localhost/")
For Each _dir In IO.Directory.GetDirectories(path)
Try
Console.WriteLine("Lancement de la requête : http://locahost" + _dir.Replace(path, "").Replace("\", "/"))
myHttpWebRequest = Net.WebRequest.Create("http://locahost" + _dir.Replace(path, "").Replace("\", "/"))
myHttpWebResponse = myHttpWebRequest.GetResponse()
Catch ex As Exception
End Try
Next
Console.WriteLine("Fin de la pré-compilation du site http://localhost/")
End If
Next
Catch ex As Exception
IO.File.AppendAllText("logErreurs.txt", Now.ToString + " - " + ex.Message + vbNewLine + vbNewLine)
Console.WriteLine(ex.Message)
End Try |
Partager