can any one tell the meaning and functionality of this ASP file

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: can any one tell the meaning and functionality of this ASP file

  1. #1
    Join Date
    Dec 2006

    can any one tell the meaning and functionality of this ASP file

    hi youth , can any one tell the meaning and functionality of this ASP file , and i have to migrate this file into JSP file,

    can any one analyse this file and tell me how i could migrate it to JSP.

    thank you,

    SUB ReadDisplayFile(FileToRead)
    Dim tmpfile
    Dim fs
    Dim thisfile
    Dim tempSTR
    tmpfile=server.mappath(FileToRead) 'convert virtual path to physical path
    Set fs = CreateObject("Scripting.FileSystemObject") 'create instance of FileSystemObject
    Set thisfile = fs.OpenTextFile(tmpfile, 1, False) 'Open file for reading
    tempSTR=thisfile.readall 'Read contents of file
    response.write tempSTR 'Write contents of include file
    set thisfile=nothing
    set fs=nothing

    Dim filename4
    filename4="includes/" & Session("BannerName")
    Call ReadDisplayFile(filename4)

  2. #2
    Join Date
    Aug 2004
    Orange, California
    Well somewhere along the way a Session level variable called BannerName was created. The ASP Session objest is used to retreive the contents of this variable which is combined with the path "includes/" and stored in the variable filename4. This file is located on the webserver which is relative to the location of the original web page so the ReadDisplayFile sub must use the ASP Server object to map the location of this file. Then the sub creates a FileSystemObject to open and read the contents of the file into the tempSTR variable. Once that has been done then the ASP responce object is used to write the contents of tempSTR back to the web page being constructed. Finally the file is closed and the object variables are reset to free up resources.

  3. #3
    Join Date
    Dec 2003
    San Diego
    If interested, you can also check out J-ASP by NetCoole Migration Services.

    Good luck,
    Michael Sanchez
    Managing Technical Editor
    Forum Moderator

Similar Threads

  1. Replies: 4
    Last Post: 06-21-2005, 08:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center