Interactive web pages for your CD Interactive web pages for your CD
Home page
Demo
Examples
Case Studies
Documentation

Built-In Objects

  • Technical details

  • The Server Object

    Server.GetLastError
    The call  Server.GetLastError  is not currently supported.

    Server.Execute
    The call  Server.Execute  is not currently supported.

    Server.ScriptTimeout
    The Dynamic-CD default is 30 seconds.

    Server.Transfer
     Server.Transfer  is currently equivalent to calling  Response.Redirect .


    Additional Server Variables
    Additional variables whose values are returned by a call to  Request.ServerVariables  :
    • ROOT_DIR
      the DOS path of the Dynamic-CD root directory
    • WINDOWS_TEMP_DIR
      the DOS path of the current user's Windows temporary directory

    The path returned has NO terminating slash.


    Server support for password protection
    The following calls support Dynamic-CD password protection
    
      Server.EnableUser userName, userPwd
      Server.ClearUser userName, userPwd
      Server.ClearAllUsers
     Server.EnableUser  enables the userName, userPwd combination so that any files protected with that combination will be opened automatically when navigated to.

     Server.ClearUser  clears the userName, userPwd combination so that any files protected with that combination will require the user to enter a password when navigated to.

     Server.ClearAllUsers  clears all userName, userPwd combinations.

    Global file access control
    The property  Server.GlobFileAccess  and the method  Response.UnlockRedirect  give you detailed control of access to password-protected files.

    
    <%
    ' disallow global access to protected files
    ' -----------------------------------------
      Server.GlobFileAccess = FALSE
    
    ' pick up variables and redirect
    ' ------------------------------
      userName = trim( Request.Form( "userName"))
      userPwd = trim( Request.Form( "userPwd"))
      Response.UnlockRedirect "ProtectedText.doc", userName, userPwd
    %>
    <HTML><BODY>
    Sorry, you do not have permission to view this file.
    </BODY></HTML>

    Setting  Server.GlobFileAccess = FALSE  switches off the standard processing of password-protected files : any direct access to the files does not result in password-entry dialog ; the user is denied access immediately.

    Access to password-protected files is subsequently only available under script control via  Response.UnlockRedirect  which unlocks ProtectedText.doc and redirects the user there. If the userName/userPwd is incorrect, the call fails and the script continues.

     Server.EncryptFile  can be used by Professional and Consultancy Licence holders to automate the production of password - protected CDs. Look here for further details.


    Server.FileExists
     Server.FileExists( pathAndFileName)   provides support for platforms where the Scripting.FileSystemObject is not available.
    
      path = Request.ServerVariables( "ROOT_DIR")
      myDb = path + "\resources\myDb.mdb"
      IF Not Server.FileExists( myDb) THEN
    	Response.Redirect "panic.asp"
      END IF
    	


    Server.LogFileName
     Server.LogFileName  sets the name of the log file that is appended to by calls to Response.AppendToLog.

    The default value is WINDOWS_TEMP_DIR\temp\dyncdlog.txt, where WINDOWS_TEMP_DIR is current user's Windows temporary directory.

    The current user's temporary directory can be determined by calling
    Request.ServerVariables("WINDOWS_TEMP_DIR").
    The current value is
    .


    Stop Dynamic-CD under script control
    The  Server.StopServer  method terminates Dynamic-CD after all pending browser requests have been honoured. This is an automated alternative to informing the user to stop Dynamic-CD by clicking on the icon in the tray,
    <%
      ' other code
    
      ' then terminate Dynamic-CD
      Server.StopServer
    %>


    Server.IsInternetConnected method
    The method Server.IsInternetConnected returns a boolean value indicating whether the user is connected to the Internet.

    This can be used - for example - to turn on or off external links :

      To view the Dynamic-CD website
    <% if Server.IsInternetConnected then %>
          <A HREF="http://www.dynamic-cd.com">click here</A>
    <% else %>
          you must first connect to the Internet.
    <% end if %>
    



     
       Home     Purchase     Licenses     Limitations     Version details     Site map     Contact     Copyright © 2000-2022 phdcc
      Dynamic-CD : the web server on CD Learn more | What's new