how to make a htm page by ASP FSO

W

work4u

Hello, I tried to use FSO to have a function.

the idea is when people fill out the form which include the property
information.

such as hotel info, hotel image,..., then when they hit the button

the system will create a html page for this resort with some name like

http://www.resorts.com/resort/resort23432345.htm, and name of resort
page should be
generate dynamic by FSO function from a ASP page.


and i do try use FSO, but hard to find the info how to generate a HTM
page by ASP File System Object
function.


and hints will be great appreciate it.
 
R

ross b

Hello,

I'd like to know how to generate a htm page by asp function rather than
write to a txt file, and I know that File System Object can finish that
work.

a simple link as below
http://rentalo.com/properties/1_bedroom_condo_on_the_beach_huatulcomexic
o.html

and i think this page is automatic generate when people filled out a
form . and i just would like to have a function to finish this kind of
job.

so, if anyone can show me where can i find some sample code, that will
be a great appeciate it.

Ross
 
B

Bite My Bubbles

Try this:

<%
theSite="http://www.resorts.com/resort/resort23432345.htm"

Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.Open "GET", theSite
objWinHttp.Send

StrHTML = replace( objWinHttp.ResponseText, "<html>","<html><BASE href=" &
theSite & ">")

dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")

set f=fs.CreateTextFile("e:\myfile.htm",true)

f.WriteLine StrHTML

f.close
set f=nothing
set fs=nothing
set objWinHttp= nothing
%>
 
R

ross b

Hi

thank you very much for the code.

and i just tried it and it seem something still wrong.

so I did replace "http://www.resorts.com/resort/resort23432345.htm"

with an real full URL like "http://www.vegasall.com/index.asp"

and change this part "set f=fs.CreateTextFile("e:\myfile.htm",true)"
with the real path, and saved this page as htm.asp page

so when i run this page in my PC, it should like convert index.asp code
and save to my pc as name myfile.htm.

but when i runing the asp page, the page just like frozen there. I am
wondering do i need to configure to run FSO ?

PS: i use win200 server and runing IIS, and i use dreamweaver ultradev
to run the page...


thanks again for your continue help.

Ross
 
B

Bite My Bubbles

it is more likely that you need to install the latest service pack so the
first component will run.
response.write the strHTML.
if that fails then
Goto microsoft and download the winhttp component
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top