實驗目的:驗證主動釋放記憶體變數是否有價值. 實驗原始代碼: <script language=vbscript runat=server> Dim temp1,temp2 'temp1 = space(1024*1024*50) '50MB for i = 0 to 5000000 ' 延遲 next 'temp1="" '開關變數 'temp2 = space(1024*1024*50) '50MB for i = 0 to 5000000 ' 延遲 next Response.
複製代碼 代碼如下:<%@LANGUAGE="JAVASCRIPT"%> <title>Google PR值查詢 asp程式</title> <% function hexdec(str) { return parseInt(str,16); } function zeroFill(a,b) { var z = hexdec(80000000); if (z & a) { a = a>>1; a &= ~z; a |= 0x40000000;
複製代碼 代碼如下: '排序 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 =
複製代碼 代碼如下: public function fillzero(l1) if len(l1)=1 then fillzero="0"&l1 else fillzero=l1 end if end function 用法樣本: 複製代碼 代碼如下: response year(now)&month(now)&day(now) 結果:201116 response year(now)&fillzero(month(now))&fillzero(day(now)) 顯示結果:20110106
複製代碼 代碼如下:<% '==============================================================檢查提交資料合法性 Function CheckInput() '--------定義部份------------------ Dim Fy_Post,Fy_Get,Fy_In,Fy_Inf,Fy_Xh,Fy_db,Fy_dbstr,Kill_IP,WriteSql
複製代碼 代碼如下:一 遍曆Request 方式1: <% For Each r In Request.QueryString Response.Write "Request("""&r&""") = " & Request(r) Response.Write "<p>" Next %> 方式2: <%
數組的定義 Dim MyArray MyArray = Array(1,5,123,12,98) 可擴充數組 Dim MyArray() for i = 0 to 10 ReDim Preserve MyArray(i) MyArray(i)=i next 將一個字串分割並返回分割結果的數組 Dim MyArray