📄 global.asa
字号:
<!--#INCLUDE FILE="..\lib\miConst.asp"-->
<!--#INCLUDE FILE="app_const.asp"-->
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
'''''''''''''''''''''''''''''''''''''''
' Session_OnStart - Initializes the session on startup.
' Creates session globals and sets them to there initial values.
' Rebuilds the last session if a user timed out and then submitted.
'
Sub Session_OnStart
Dim strDirname
' Set the map image file type and paths. Map images are created
' in the absolute path set below. The relative path is used when
' creating the HTML so the web server knows where to find the images.
Session(SESN_MAPFILETYPE) = miFormatGIF
Session(SESN_MAPFILEEXT) = "GIF"
' Specify the name of the virtual directory where we'll generate GIF images.
' If you want to create GIFs in a directory other than "mapimage",
' you will need to modify the following assignment:
strDirname = "/mapimage"
' Build a DOS-style file path to the directory where we will create GIF files,
' such as: "C:\INETPUB\WWWROOT\MAPIMAGE\"
' Note that we include a "\" character at the end.
Session(SESN_ABSMAPPATH) = Server.MapPath(strDirname) & "\"
' Build a URL to the directory where we created the GIFs,
' such as: "http://machine_name/mapimage/"
' Note that we include a "/" character at the end.
Session(SESN_RELMAPPATH) = "http://" & Request.ServerVariables("SERVER_NAME") & strDirname & "/"
Session(SESN_IMAGEPATH) = "" 'we will generate this file name later on.
'***********************************************************
' NOTE: Instead of using hard-coded strings, such as the ones
' defined above, you might want to read settings from the registry.
'***********************************************************
' Set various defaults.
Session(SESN_TOOL) = TOOL_IN ' default Tool is the Zoom In tool
'Session(SESN_WIDTH) = 980 ' default image width, in pixels.
'Session(SESN_HEIGHT) = 889 ' default image height.
Session(SESN_MAPNAME) = "Default" ' Specify the name of the server group
Session(SESN_FIRST_ACCESS) = True ' Set flag, so we know to initialize the map
' Set the number of minutes before the user session times out.
Session.Timeout = 3
' Initialize the session variables that will contain our objects
Set Session(cMapXObject) = Nothing
Set Session(cMapXCourierObject) = Nothing
End Sub
Sub Session_OnEnd
Dim strImagePath
' If we still have a map engine, release it. (We probably don't
' have a map engine, since this app is set up to use Page scope...
' but we'll test just to be on the safe side.)
If Not (Session(cMapXObject) Is Nothing) Then
Set Session(cMapXObject) = Nothing
Session(cMapXCourierObject).ReleasemapX(0)
End If
' Delete any obsolete GIFs that were generated during
' this session, by calling the DeleteFiles method.
If Len(Session(SESN_IMAGEPATH)) > 0 Then
'... then the user ran the application, and created a
'GIF file that now needs to be deleted.
strImagePath = Session(SESN_ABSMAPPATH) & Session(SESN_IMAGEPATH)
Session(cMapXCourierObject).DeleteFiles(strImagePath)
End If
Set Session(cMapXCourierObject) = Nothing
End Sub
'Sub Application_OnStart
'End Sub
'Sub Application_OnEnd
'End Sub
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -