推薦:asp怎樣利用InstrRev()獲取文件名InstrRev函數,從字符串的最後一個搜索起,前面字符串。 % Dim strTXT,pos strTXT=www.webjx.com pos=instrRev(strTXT,.) Response.Write pos % 我們搜索的起始是倒序,從com前的一個點。起始的字符的長度,含此點,共十個字符,返回的結果將是9。 通過
<html> <head> <http-equiv=Content-Type content=text/html; charset=gb2312> <title></title> </head> <body> <% LANGUAGE = VBScript % > <% Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 Dim filename filename = test.txt '缺省相對路徑是c:winnt Set fs = CreateObject(Scripting.FileSystemObject) Set f = fs.GetFile(filename) Set readf = f.OpenAsTextStream(ForReading,TristateFalse) '第一個參數可選。輸入/輸出模式,是下列三個常數之一: ' ForReading=1只讀、ForWriting=2 可讀寫或ForAppending=3追加 '第二個參數也為可選。三個Tristate 值之一, ' 指出以何種格式打開文件。忽略此參數,則文件以ASCII '格式打開。 TristateUseDefault=-2 以系統默認格式打開文件、 'TristateTrue=-1 以Unicode 格式打開文件或TristateFalse=0 '以ASCII 格式打開文件。 '也可用OpenTextFile方法打開文件 s = readf.ReadLine Do While readf.AtEndOfLine <> True s = readf.ReadLine Response.write s & '逐行讀文件並寫出 Loop readf.close %> </body> </html> |
分享:一種比like子句速度快的模糊查詢語法一般來說使用模糊查詢,大家都會想到LIKE select * from table where a like '%字符%' 如果一個SQL語句中用多個like模糊查詢,並且記錄條數很大,那速度一定會很慢。 下面兩種方法也可實現模糊查詢: select * from table where patindex('%字符%',a)0 sele