日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
ASP新手之常用源代碼的總結(jié)(下)

ASP是Active Server Page的縮寫,意為“動態(tài)服務(wù)器頁面”。ASP是微軟公司開發(fā)的代替CGI腳本程序的一種應(yīng)用,它可以與數(shù)據(jù)庫和其它程序進(jìn)行交互,是一種簡單、方便的編程工具。接上篇>>

在威海等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站建設(shè)、成都網(wǎng)站制作 網(wǎng)站設(shè)計(jì)制作按需規(guī)劃網(wǎng)站,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,網(wǎng)絡(luò)營銷推廣,成都外貿(mào)網(wǎng)站建設(shè),威海網(wǎng)站建設(shè)費(fèi)用合理。

11.ACCESS數(shù)據(jù)庫連接:

 
 
 
  1. <%   
  2. option explicit   
  3. dim startime,endtime,conn,connstr,db   
  4. startime=timer()   
  5. '更改數(shù)據(jù)庫名字   
  6. db="data/dvBBS5.mdb"   
  7. Set conn = Server.CreateObject("ADODB.Connection")   
  8. connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)   
  9. '如果你的服務(wù)器采用較老版本Access驅(qū)動,請用下面連接方法   
  10. 'connstr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(db)   
  11. conn.Open connstr   
  12. function CloseDatabase   
  13. Conn.close   
  14. Set conn = Nothing   
  15. End Function   
  16. %> 

12.SQL數(shù)據(jù)庫連接:

 
 
 
  1. <%   
  2. option explicit   
  3. dim startime,endtime,conn,connstr,db   
  4. startime=timer()   
  5. connstr="driver={SQL Server};server=HUDENQ-N11T33NB;uid=sa;pwd=xsfeihu;database=dvbbs"   
  6. Set conn = Server.CreateObject("ADODB.Connection")   
  7. conn.Open connstr   
  8. function CloseDatabase   
  9. Conn.close   
  10. Set conn = Nothing   
  11. End Function   
  12. %> 

13.用鍵盤打開網(wǎng)頁代碼: 

 
 
 
  1.  

這里是Ctrl+Enter和Alt+S的代碼 自己查下鍵盤的ASCII碼再換就行

14.讓層不被控件復(fù)蓋代碼:

 
 
 
 # 前面   
  •  # 后面   
  •    
  •  

    15.動網(wǎng)FLASH廣告代碼:

     
     
     
    1. codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0
    2.  width="468" height="60"> 
    3.  
    4.  
    5. pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash;
    6. ;;;;;;;;;;; type="application/x-shockwave-flash" width="468" height="60">  

    16.VBS彈出窗口小代碼:

     
     
     
    1.  

    17.使用FSO修改文件特定內(nèi)容的函數(shù):

     
     
     
    1. function FSOchange(filename,Target,String)   
    2. Dim objFSO,objCountFile,FiletempData   
    3. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")   
    4. Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)   
    5. FiletempData = objCountFile.ReadAll   
    6. objCountFile.Close   
    7. FiletempData=Replace(FiletempData,Target,String)   
    8. Set objCountFile=objFSO.CreateTextFile(Server.MapPath(filename),True)   
    9. objCountFile.Write FiletempData   
    10. objCountFile.Close   
    11. Set objCountFile=Nothing   
    12. Set objFSO = Nothing   
    13. End Function 

    18.使用FSO讀取文件內(nèi)容的函數(shù):

     
     
     
    1. function FSOFileRead(filename)   
    2. Dim objFSO,objCountFile,FiletempData   
    3. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")   
    4. Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)   
    5. FSOFileRead = objCountFile.ReadAll   
    6. objCountFile.Close   
    7. Set objCountFile=Nothing   
    8. Set objFSO = Nothing   
    9. End Function 

    19.使用FSO讀取文件某一行的函數(shù):

     
     
     
    1. function FSOlinedit(filename,lineNum)   
    2. if linenum < 1 then exit function   
    3. dim fso,f,temparray,tempcnt   
    4. set fso = server.CreateObject("scripting.filesystemobject")   
    5. if not fso.fileExists(server.mappath(filename)) then exit function   
    6. set f = fso.opentextfile(server.mappath(filename),1)   
    7. if not f.AtEndofStream then   
    8. tempcnt = f.readall   
    9. f.close   
    10. set f = nothing   
    11. temparray = split(tempcnt,chr(13)&chr(10))   
    12. if lineNum>ubound(temparray)+1 then   
    13. exit function   
    14. else   
    15. FSOlinedit = temparray(lineNum-1)   
    16. end if   
    17. end if   
    18. end function 

    20.使用FSO修改文件特定內(nèi)容的函數(shù):

     
     
     
    1. function FSOchange(filename,Target,String)   
    2. Dim objFSO,objCountFile,FiletempData   
    3. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")   
    4. Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)   
    5. FiletempData = objCountFile.ReadAll   
    6. objCountFile.Close   
    7. FiletempData=Replace(FiletempData,Target,String)   
    8. Set objCountFile=objFSO.CreateTextFile(Server.MapPath(filename),True)   
    9. objCountFile.Write FiletempData   
    10. objCountFile.Close   
    11. Set objCountFile=Nothing   
    12. Set objFSO = Nothing   
    13. End Function 

    21.使用FSO讀取文件內(nèi)容的函數(shù):

     
     
     
    1. function FSOFileRead(filename)   
    2. Dim objFSO,objCountFile,FiletempData   
    3. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")   
    4. Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)   
    5. FSOFileRead = objCountFile.ReadAll   
    6. objCountFile.Close   
    7. Set objCountFile=Nothing   
    8. Set objFSO = Nothing   
    9. End Function 

    22.使用FSO讀取文件某一行的函數(shù):

     
     
     
    1. function FSOlinedit(filename,lineNum)   
    2. if linenum < 1 then exit function   
    3. dim fso,f,temparray,tempcnt   
    4. set fso = server.CreateObject("scripting.filesystemobject")   
    5. if not fso.fileExists(server.mappath(filename)) then exit function   
    6. set f = fso.opentextfile(server.mappath(filename),1)   
    7. if not f.AtEndofStream then   
    8. tempcnt = f.readall   
    9. f.close   
    10. set f = nothing   
    11. temparray = split(tempcnt,chr(13)&chr(10))   
    12. if lineNum>ubound(temparray)+1 then   
    13. exit function   
    14. else   
    15. FSOlinedit = temparray(lineNum-1)   
    16. end if   
    17. end if   
    18. end function 

    到此,關(guān)于ASP常用代碼的總結(jié)篇,就為大家介紹完了。希望對大家有幫助。


    文章名稱:ASP新手之常用源代碼的總結(jié)(下)
    瀏覽路徑:http://www.dlmjj.cn/article/dhgpjhs.html