熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp入門:asp如何保存數據

2013-11-13 10:38:46  來源: .NET編程 

  下面我們就來看看實例教程吧

  先來看看提交的頁面:

  <FORM ACTION="saveinfoasp" METHOD=post>
<! Your fields here >

  <INPUT TYPE=submit value="Submit">
</FORM>

  下面看看接收數據並保存的頁面

  <%
Set fs = CreateObject("ScriptingFileSystemObject")
Folderpath=servermappath("") & "/cgibin/messages
Wcounter=Folderpath &"/countertxt"

  Set fs = CreateObject("ScriptingFileSystemObject") 
    if fsFolderExists(Folderpath) then 
        Set a = fsOpenTextFile(Wcounter) 
        hits = Clng(aReadLine) 
        hits = hits +  
        aclose 
    else 
        Set a = fsCreateFolder(Folderpath) 
        hits=
    end if

  Set a = fsCreateTextFile(WcounterTrue) 
aWriteLine(hits) 
aClose
Set fs=nothing

  Set fs = CreateObject("ScriptingFileSystemObject") 
Set a = fsCreateTextFile(Folderpath & "" & hits & "txt") 
   For Each x In RequestForm
      aWriteLine(x &": " & RequestForm(x))
   Next
aClose 
Set a=nothing 
Set fs=nothing 
%>


From:http://tw.wingwit.com/Article/program/net/201311/14208.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.