dim conn,connstr,timesdb,rstimesdb="../www.111cn.net/#tsm_admin_data.asp"connstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(""×db&"")'on error resume next set conn =
'函數作用:擷取檔案大小function getfilesize(filename) '判斷檔案名稱是不是為空白 if filename="" then getfilesize="0kb" exit function end if dim ofso,ofile,sfile sfile=filename set
'############## 返回一個路徑的目錄名#########################################################################function getpath(givepath) '返回一個路徑的目錄名 dim i,num,path path=givepath for i=0 to len(path)-1 if
'本文章提供了二款asp檔案操作函數,read開啟檔案讀取全部內容,wirte把內容寫入到一個檔案。function read(path) set mf=server.createobject("scripting.filesystemobject") set mt=mf.opentextfile(server.mappath(path),1,true,-2) if mt.atendofstream=true
'二款簡單asp來判斷檔案存或目錄存在的函數,在asp中這樣做只要用到filesystemobject就ok了。function isdir(givepath) dim realpath,path,num,fs,i set fs = createobject("scripting.filesystemobject") path=givepath if fs.folderexists(path)=true then
'本文章提供一款比較完美的asp資料庫連接代碼哦,他不但串連access資料庫同時也包括了資料庫中斷連線代碼函數。dim conn,rs,sql,dbpathset conn=server.createobject("adodb.connection")dbpath="web_data.asp" '資料庫路徑call conndate()sub conndate() if err then