複製代碼 代碼如下:'排序 Function Sort1(ary) Dim KeepChecking,I,FirstValue,SecondValue KeepChecking = TRUE Do Until KeepChecking = FALSE KeepChecking = FALSE For I = 0 to UBound(ary) If I = UBound(ary) Then Exit For If ary(I) > ary(I+1) Then FirstValue =
複製代碼 代碼如下:'===================================== '獲得檔案尾碼 '===================================== Function Get_Filetxt(ByVal t0) Dim t1 IF Len(t0)<2 Or Instr(t0,".")=0 Then Get_Filetxt=False:Exit Function t1=Split(t0,".")
複製代碼 代碼如下:'============================== '格式化HTML,SDCMS加強版 '============================== Function Nohtml(ByVal t0) IF Len(t0)=0 Or IsNull(t0) Then Nohtml="" Exit Function End IF Dim Regs,Matches,Match Set Regs=New Regexp Regs.Ignorecase=True Regs.
複製代碼 代碼如下:Function getCurrentUrl() On Error Resume Next Dim strTemp If LCase(Request.ServerVariables("HTTPS")) = "off" Then strTemp = "http://" Else strTemp = "https://" End If strTemp = strTemp & Request.ServerVariables("SERVER_NAME") If
1.Default.aspx頁面 複製代碼 代碼如下:<script type="text/javascript"> function GetUser(TxtEmpID,TxtEmpName,url) { var properties = 'status:no;resizable:no;toolbar=no;menubar=no;location=no;scroll:no;dialogWidth:540px;dialogHeight:450px;' var
複製代碼 代碼如下:<% Dim oConn, ors, aRows Dim i,j Set oConn=Server.CreateObject("ADODB.Connection") oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database/newasp.resx") Set ors=oConn.Execute("Select TOP 5
複製代碼 代碼如下:function checkip(checkstring)'用正則判斷IP是否合法 dim re1 set re1=new RegExp re1.pattern="^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$" re1.global=false re1.Ignorecase=false checkip=re1.test(checkstring) set re1=nothing end function 複製代碼
刪除單條記錄 複製代碼 代碼如下:id = saferequest("id") sql="delete from table1 where whereid>"&id&"" rs.open sql,conn,1,3 response.write "<script>alert('刪除成功');location.href='del.asp';</script>" set rs=nothing set conn=nothing 這是過濾非法字元函數