Search : 
  Powered by FindinSite

ASP Documentation
• Introduction
• Getting started
• Dynamic-CD wizard
Passwords & Encryption
• Overview
• Example 1
• Example 2
• The script language
• Script examples
• Database scripts
Technical details
• Applications
• Built-in objects
• Character Encoding
• Cookies
• Database CDs
• Development tips
• FAQs
• Future developments
• Global.asa
• Network support
• Object registration
• Resources
• ScriptingContext
• Server-side includes
• Sessions
• Technical limits
Running Dynamic-CD on a network.

Multi-user considerations
Dynamic-CD can be run on a network server in a number of ways.

A server CD drive could be mapped as a user's local drive and Dynamic-CD could be run from there. In this scenario, such users will be running their own copy of Dynamic-CD in single-user mode.

Dynamic-CD can also be run in multi-user mode on a server with remote users accessing the Dynamic-CD by replacing the single-user IP address "" with the IP address of the server.

The Passwords and Cookies stored by Dynamic-CD are tied to user's IP address. This means that when a user with the username/password "user1/pass1" accesses a protected file, a network user with the same username/password will not be able to access user1/pass1 files until they also have also entered the correct username/password combination.

By default, Dynamic-CD does not permit network access from IP addresses other than the starting address "". However, network access can be enabled on the Advanced Settings tab of Dynamic-CD-Wizard.

Other security considerations
It is of course a simple matter for a user to copy a Dynamic-CD and inform others about the usernames and passwords. To protect sensitive data, other security techniques include :
  • Adding a hardware dongle, for which PHD would provide custom support
  • Product activation over the Internet.
The latter means that, when run on a new computer, Dynamic-CD would connect to an external server across the Internet. The server keeps track of the computers running your sofware. If authorized, the server sends a message back to Dynamic-CD, letting it proceed. See the SecureCD example.

Access control via scripts
If you permit general network access, you could implement detailed access control with the following technique :

  host = Request.ServerVariables( "HTTP_HOST")
  IF InStr( host, "") <= 0 THEN
    Response.Write "<HTML><BODY><H1>"
    Response.Write "Sorry, network access is prohibited"
    Response.Write "</H1></BODY></HTML>"

Adding this security header as a Server-Side Include to all sensitive files would prohibit access from any IP address other than "".

Response.BinaryWrite file streaming
If you use scripts to create a new file on the hard disk of the machine running Dynamic-CD, a standard procedure for displaying the file is to use a  file://  URL. For example, the chart example, using Office Web Components writes a GIF file and has the browser display it direct from the Windows temporary directory :

  ' create the output file in the current user's Windows temporary directory
  winTempDir = Request.ServerVariables( "WINDOWS_TEMP_DIR")
  gifFileName = winTempDir + "\owcChart.gif"

  'Save the current chart to a GIF file
  m_cspace.ExportPicture gifFileName, "gif", 800, 400
  ' create a URL to show the GIF file
  gifFileName = replace( gifFileName, ":", "|")
  gifFileName = replace( gifFileName, "\", "/")
  fileURL = "file:///" + gifFileName
   <IMG SRC="<%=fileURL%>">
If, however, the user is accessing Dynamic-CD over a network, this technique will fail because the local drive specified in the  file://  URL will not be available to the user.

The solution is to send the file over the network using  Response.BinaryWrite . However, you will not be able to open and read a binary file without additional support - the Scripting.FileSystemObject does not support reading binary files. Instead, use the BinaryFileStream object (described below) to open the binary GIF file and send its contents as binary data using Response.BinaryWrite :

  objName = "BinaryFileStream.Object"
  Set binFileObj = server.CreateObject( objName)
  Response.BinaryWrite binFileObj.GetFileBytes( gifFileName)
The BinaryFileStream object can be created using VisualBasic :

Public Function GetFileBytes(FullFilePath As String) As Variant
  Dim ctBytes As Long
  Dim bytes() As Byte
  Dim fno As Long
  On Error GoTo errReadAll
  fno = FreeFile()
  Open FullFilePath For Binary Access Read As fno
  ctBytes = LOF(fno)
  ReDim bytes(ctBytes)
  Get fno, , bytes
  Close fno
  GetFileBytes = bytes
  Exit Function

  Err.Raise vbObjectError+1, "GetFileBytes", Err.Description
  GetFileBytes = Array(0)
End Function
and then registered on the machine running Dynamic-CD.

© Copyright 2000-2007 PHD Computer Consultants Ltd