推薦:解析ASP日期格式的數據加減計算方法在ASP中為我們提供了專門的日期加減函數。 1.日期相加 DateAdd函數 返回已添加指定時間間隔的日期。 DateAdd(interval,number,date) DateAdd函數的語法有以下參數 (1)interval必選項。字符串表達式,表示要添加的時間間隔。有關數值,請參閱“設置”部分。
ASP程序可通過 VBScript 和其他方式調用子程序。<html> <head> <% sub vbproc(num1,num2) response.write(num1*num2) end sub %> </head> <body> <p>您可以像這樣調用一個程序:</p> <p>結果:<%call vbproc(3,4)%></p> <p>或者,像這樣:</p> <p>結果:<%vbproc 3,4%></p> </body> </html> |
<%@ language="javascript" %> <html> <head> <% function jsproc(num1,num2) { Response.Write(num1*num2) } %> </head> <body> <p> 結果:<%jsproc(3,4)%> </p> </body> </html> |
<html> <head> <% sub vbproc(num1,num2) Response.Write(num1*num2) end sub %> <script language="javascript" runat="server"> function jsproc(num1,num2) { Response.Write(num1*num2) } </script> </head> <body> <p>結果:<%call vbproc(3,4)%></p> <p>結果:<%call jsproc(3,4)%></p> </body> </html> |
<html> <head> <% sub vbproc(num1,num2) response.write(num1*num2) end sub %> </head> <body> <p>Result: <%call vbproc(3,4)%></p> </body> </html> |
<%@ language="javascript" %> <html> <head> <% function jsproc(num1,num2) { Response.Write(num1*num2) } %> </head> <body> <p>Result: <%jsproc(3,4)%></p> </body> </html> |
分享:如何將網頁中的數字生成圖片的ASP程序將下面代碼保存為myimg.asp,在要顯示數字(比如QQ號等)的位置插入imgsrc=myimg.asp?tel=010-0000000即可。 % CallCom_CreatValidCode(Request.QueryString(tel)) PublicSubCom_CreatValidCode(pTel) ’----------禁止緩存 Response.Expires=0 Response.
新聞熱點
疑難解答