Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

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,
swathi.

<%
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
thisfile.Close
set thisfile=nothing
set fs=nothing
END SUB

Dim filename4
filename4="includes/" & Session("BannerName")
Call ReadDisplayFile(filename4)
%>
[928 byte] By [manne] at [2007-11-11 10:05:43]
# 1 Re: can any one tell the meaning and functionality of this ASP file
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.
Ron Weller at 2007-11-11 17:23:10 >
# 2 Re: can any one tell the meaning and functionality of this ASP file
If interested, you can also check out J-ASP by NetCoole Migration Services.

Good luck,
msanchez at 2007-11-11 17:24:18 >