%@ Language = "VBScript" %> <% Response.Buffer = True %> <% ' Prepare variables. Dim oFS, oFSPath Dim sServername, sServerinst, sPhyspath, sServerVersion Dim sServerIP, sRemoteIP Dim sPath, oDefSite, sDefDoc, sDocName, aDefDoc Dim bSuccess ' This value is used later to warn the user if a default document does not exist. Dim iVer ' This value is used to pass the server version number to a function. bSuccess = False iVer = 0 ' Get some server variables to help with the next task. sServername = LCase(Request.ServerVariables("SERVER_NAME")) sServerinst = Request.ServerVariables("INSTANCE_ID") sPhyspath = LCase(Request.ServerVariables("APPL_PHYSICAL_PATH")) sServerVersion = LCase(Request.ServerVariables("SERVER_SOFTWARE")) sServerIP = LCase(Request.ServerVariables("LOCAL_ADDR")) ' Server's IP address sRemoteIP = LCase(Request.ServerVariables("REMOTE_ADDR")) ' Client's IP address ' If the querystring variable uc <> 1, and the user is browsing from the server machine, ' go ahead and show them localstart.asp. We don't want localstart.asp shown to outside users. If Not (sServername = "localhost" Or sServerIP = sRemoteIP) Then Response.Redirect "iisstart.asp" Else ' Using ADSI, get the list of default documents for this Web site. sPath = "IIS://" & sServername & "/W3SVC/" & sServerinst Set oDefSite = GetObject(sPath) sDefDoc = LCase(oDefSite.DefaultDoc) aDefDocs = split(sDefDoc, ",") ' Make sure at least one of them is valid. Set oFS = CreateObject("Scripting.FileSystemObject") For Each sDocName in aDefDocs If oFS.FileExists(sPhyspath & sDocName) Then If InStr(sDocName,"iisstart") = 0 Then ' IISstart doesn't count because it is an IIS file. bSuccess = True ' This value will be used later to warn the user if a default document does not exist. Exit For End If End If Next ' Find out what version of IIS is running. Select Case sServerVersion Case "microsoft-iis/5.0" iVer = 50 ' This value is used to pass the server version number to a function. Case "microsoft-iis/5.1" iVer = 51 Case "microsoft-iis/6.0" iVer = 60 End Select %>
|
||||||||
|