主頁 > 知識庫 > 如何用ASP輸出HTML文件?

如何用ASP輸出HTML文件?

熱門標簽:教育機構地圖標注 語音電銷機器人視頻 自適應地圖標注 400電話是怎么申請 重慶400電話哪里辦理 常州智能外呼電銷機器人如何 武漢如何辦理400電話 遼寧營銷智能外呼系統(tǒng)價格多少 推銷電話機器人怎么打電話的

!--#include file="top.inc"-->
%
u_title=request.form("u_title")

' 檢查標題是否被輸入.
if u_title = "" then
%>
form method="POST" action="%= request.servervariables("script_name") %>">
 !--
當沒有標題輸入時顯示輸入框-->

  p>
文件標題br>
  input type="text" name="u_title" size="35">/p>
  p>Font Sizebr>
  select size="1" name="u_text_size">
  option selected value="1">1/option>
  option value="2">2/option>
  option value="3">3/option>
  option value="4">4/option>
  option value="5">5/option>
  option value="6">6/option>
  nbsp;
  /select>/p>
  p>
1br>
  textarea rows="2" name="u_paragraph1" cols="35">/textarea>/p>
  p>
2br>
  textarea rows="2" name="u_paragraph2" cols="35">/textarea>input type="submit" value="
提交" >/p>
/form>
%
end if
%>

%
if u_title > "" then
    u_title=request.form("u_title")
    u_paragraph1=request.form("u_paragraph1")
    u_paragraph2=request.form("u_paragraph2")
    u_text_color=request.form("u_text_color")
    u_text_size=request.form("u_text_size")
    g_filename=replace(u_title," ","_")

' 如果有一個用戶輸入了標題,則獲取所有的用戶輸入的內容.

set fso = createobject("scripting.filesystemobject")
Set act = fso.CreateTextFile(server.mappath("write2htm/"g_filename "-" month(date()) day(date()) year(date()) ".htm"), true)
創(chuàng)建create the text (html) file文件到服務器,并添加mmddyyyy 格式年月日.

寫所有用戶輸入的text (html) 文件, .htm 擴展名文件可以很容易地轉換成你網站最需要的.asp .inc文件.
    act.WriteLine "html>"
    act.WriteLine chr(13)
    act.WriteLine "title>" u_title "/title>"
    act.WriteLine chr(13)
    act.WriteLine "body bgcolor='#FFFFFF'>"
    act.WriteLine chr(13)
    act.WriteLine "p align='center'>font face='arial' size='" u_text_size "'>"
    act.WriteLine chr(13)
    act.WriteLine  u_title "/p>"
    act.WriteLine chr(13)
    act.WriteLine "p align='left'>font face='arial' size='"u_text_size"'>"
    act.WriteLine chr(13)
    act.WriteLine  u_paragraph1 "/p>"
    act.WriteLine chr(13)
    act.WriteLine "p align='left'>font face='arial' size='" u_text_size "'>"
    act.WriteLine chr(13)
    act.WriteLine u_paragraph2 "/p>"
    act.WriteLine chr(13)
    act.WriteLine "p>nbsp;/p>p>nbsp;/p>p>nbsp;/p>"
    act.WriteLine "p align='center'>font face='arial' size='" u_text_size "'>"
    act.WriteLine "
此文件被創(chuàng)建!"
    act.WriteLine  now() "/p>"
act.Close

' 關閉文件.
%>
您的頁面已成功創(chuàng)建!請點擊查看.
a href="write2htm/%= g_filename "-" month(date()) day(date()) year(date())  %>.htm"
target="_blank">
查看/a>
br>
br>
% response.write "html>"
    response.write chr(13)
    response.write "title>" u_title "/title>"
    response.write chr(13)
    response.write "body bgcolor='#FFFFFF'>"
    response.write chr(13)
    response.write "p align='center'>font face='arial' size='" u_text_size "'>"
    response.write chr(13)
    response.write  u_title "/p>"
    response.write chr(13)
    response.write "p align='left'>font face='arial' size='"u_text_size"'>"
    response.write chr(13)
    response.write  u_paragraph1 "/p>"
    response.write chr(13)
    response.write "p align='left'>font face='arial' size='" u_text_size "'>"
    response.write chr(13)
    response.write u_paragraph2 "/p>"
    response.write chr(13)
    response.write "p>nbsp;/p>p>nbsp;/p>p>nbsp;/p>"
    response.write "p align='center'>font face='arial' size='" u_text_size "'>"
    response.write "
此文件被創(chuàng)建!"
    response.write  now() "/p>"
end if
%>
!--#include file="bottom.inc"-->

 

標簽:遵義 柳州 中山 邯鄲 威海 襄陽 雞西 朔州

巨人網絡通訊聲明:本文標題《如何用ASP輸出HTML文件?》,本文關鍵詞  如,何用,ASP,輸出,HTML,文件,;如發(fā)現(xiàn)本文內容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內容系統(tǒng)采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《如何用ASP輸出HTML文件?》相關的同類信息!
  • 本頁收集關于如何用ASP輸出HTML文件?的相關信息資訊供網民參考!
  • 推薦文章