home *** CD-ROM | disk | FTP | other *** search
- <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
-
- Sub Session_OnStart
-
- On Error Resume Next
-
- ' Determine if we are using IE and set session variable to major version number
- On Error Resume Next
- Dim br
- Set br = Server.CreateObject("MSWC.BrowserType")
- If Err.Number = 0 Then
- If br.browser = "IE" Then
- Session("IEVersion") = CInt(br.majorver)
- End If
- End If
-
- 'Set session variable for whether to generate pages using RDS (such as DetailInsurance.asp)
- If Session("IEVersion") >= 4 And Application("RDSAvailable") = "True" Then
- Session("UseRDS") = "True"
- Else
- Session("UseRDS") = "False"
- End If
-
- End Sub
-
- Sub Application_OnStart
-
- On Error Resume Next
-
- ' Note that this application assumes that the dsn specified in prefs.txt is in
- ' the ODBC default directory for file DSN locations.
-
- ' If RDS not available on your server, you should change "RDSAvailable" value in
- ' prefs.txt to "False"!
-
- Application.Lock
-
- ' Use the Prefs.txt file to set Application Variables.
- Dim stTextLine, intEqualPosition, stVarName, stVarValue, fso, txtSettings
- Set fso = Server.CreateObject("Scripting.FileSystemObject")
- set txtSettings = fso.OpenTextFile(Server.MapPath("Prefs.txt"))
- Do Until txtSettings.AtEndOfStream
- stTextLine = txtSettings.ReadLine
- intEqualPosition = Instr(1, stTextLine, "=")
- If intEqualPosition <> 0 Then
- stVarName = Left(stTextLine, intEqualPosition - 1)
- stVarValue = Right(stTextLine, len(stTextLine) - intEqualPosition)
- Application(stVarName) = stVarValue
- End If
- Loop
-
- Application.Unlock
- End Sub
-
- </SCRIPT>
-