)
With javascript: document.frame.strframename.location = "strsrc"; VBScript common function: 1. Numerical functions: ABS (NUM): Return absolute value SGN (NUM): Num> 0 1; Num = 0 0; Num < 0 -1; Judgment value positive and negative HEX (NUM): Return to hexadecimal value directly: & HXX maximum 8-bit OCT (NUM): Return Eight-entered value Direct Representation: & oxx max 8 SQR (NUM): Return to square root Num> 0INT (NUM): Take INT (99.8) = 99; int (-99.2) = 100Fix (NUM): Fixing FIX (99.8) = 99; fix (-99.2) = 99Round (Num, N): Sound of Sound Round (3.14159, 3) = 3.142 Numerical Value Rouge Five Benesigned with Adjustment Round (3.25, 1) = 3.2log (NUM): Take the log Num> 0exp (N) of the end of E to: Take E Ni N The power is usually used with Num ^ nsin (num): triangular function, calculated (angle * PAI) / 180 = curvature con (NUM); ATN (NUM) 2. String function: LEN STR): Calculate the length of the Chinese character length is also one! MID (Str, Start Character, [Reading Length]): Intercept string intermediate sub-string Left (STR, NLEN): Jut from the left side of NLEN length sub-string Right (STR, NLEN): Accept NLEN from the right Length sub-string LCase (STR): String to lowercase UCase (STR): String transparent TRIM (STR): Removal string two end space Ltrim (STR): Remove the left space RTRIM (STR) on the string : Remove the right space of the string (Str, lookup string, alternative string, [start character, alternative, comparison method]): Replace string Note: Default: Start character 1; alternative number is not limited; Comparison method Case sensitive case (0) INSTR ([Start Character,] STR, Find String [, Compare Method]): Detects whether to include a sub-string optional parameter requires simultaneous choice to return to the start position INSTRREV (Str, find characters String [, Start Character] [, Comparison Method]): Reverse detection Contains whether the sub-string returns start position Space (n): Constructs N, String String (N, STR): Construction by n STR String strRreverse (STR): Reversing string split (Str, split string [, number of times] [, compare method]): Split string is a resolution flag to convert a string into a character array The selection parameter is selected at the same time, the data type conversion function: CINT (STR): Convert positive TRUE-1; FALSE 0; date distance 1899/12/31 days; time aranda 0; CSTR (STR): Date Output Format YYYY / MM / DD; Time Output Format AM / PM HH: MM: SSCLNG (STR): Similar CBOOL (NUM): NUM is not zero True; anti-falsecdate (STR): Conversion Date format 0 : #Am 12: 00: 00 #; Positive distance 1899/12/31 days Date; floating point date Decimal time CBYTE (NUM): Num <255 Convert to byte CSNG (STR):
Convert to a single precision value CDBL (STR): Convert to double precision value CCUR (STR): Convert to cash format 4. Time function: Date: Take system current date Time: Take the system Current time NOW: Take the system Current time and date value DateTime Type Timer: Take the current time distance zero second value, timer, calculate time difference DateAdd (interval, interval value, date): estimate adjacent date Datediff (interval, date one, date 2): Calculation time difference date - 2 - Date one datepart: Interval Date of Calculation DateSerial (Date): Output Date (calculated by sequence) TimeSerial (Time): Output time value (calculated by sequence) DateValue (DateTime): Remove string Medium Date TimeValue (DateTime): Remove the Time Value WEEKDAY (DATE): Calculates the Month Name of the Month: DateTime: Intercepting Month (DateTime): Intercepting Day Hour (DateTime): Intercept minute second (DateTime): Intercept second 5. Other functions: array (unit, ..): Dynamically generate an array ASC (STR): Output string first Character ASCII Code Chr (ASC): Convert ASCII as Character ENTER: CHR (13) & Chr (10) Filter (Array Name, Key String, [, Contains] [, Compare Method]): Turning the string array contains key The elements of the string are new arrays (default) [include] to take the elements of the elements that are not included in False: Connect the elements in the array to string ubound (arrayname [, dimension]): acquire array corresponding dimension Maximum LBound (ArrayName [, Dimension]): The lower boundary of the corresponding dimension of the array is generally 0randmize N: Start random number seed RND (N): obtains random number, n> 0 or empty, sequence sequence The random value, N <0, the random value is the same, N = 0, the same number of production and the previous random value is taken from the random positive number C between A and B, formula: c = int ((B-A 1 * RND a) Condition (B> a) Substragm and Custom Function SUB STRSUBNAME FUNCTION STRFUNNAME (Arg [1], ..) Subprogramcaster EXIT Subway jumps out of the exit function in the middle of the End Sub StrfunName = Value Return Value End Function [call] strsubname reference subroutine var = strfunname (arg [1], ..) Reference function subroutine and custom function can be recursive; ASP six major Object common statement demonstration:
Response: response.write strvar / "string": write the parameter value or string to the web page equivalent to embed <% = strvar / "string"%> response.end: Stop page compile in the HTML tag, and will have compiled content Output to Browser Response.buffer = true | false: Whether the cached settings are used when compiling, generally set Response.flush on the page header: Force output page Compiled part content Response.clear: Clear the data in the buffer to RESPONSE .Redirect URL: Stop page compile or output, reprint specify the desired page response.isclientConnected: Return true | false, check if the user is still connected to response.charset: Set the page encoding type, ie Response.contentType [= contentType]: Set the page file type, the same with response.expires [= number]: Set the page failure time, unit minutes Response.expiresabsolute [ = [DATE] [TIME]]: Set the absolute time of page failure response.status = statusdescription: Settings page status Description Request: Request ("passstrname": read web page transfer values, including forms and PassstrName = value & passStrName_n = value_n Form Request [.collection | Property | Method] Request.QueryString ("PassstrName": Read the form value passed by the get method and? PassstrName = valueRequest.QueryString (varible) [(index) .count] Request.form ("passstrname"): Read the pure table single field of the POST method Request.form (INDEX) .count] Request. ServerVarible: Read the client system environment variable, see Request.BinaryRead (count): Read the transfer value of the specified byte number Request.TotalBytes: The length of the query body, in bytes, only Reading: The same name form, such as: checkbox, if there is a number of values, pass the form, right, strname = value1, value2, ... You need to split the value of each value with the SPLIT function Multiple, similar to Checkbox, the value of Textarea can contain a wrap Character, convert with Replace to
to meet the format requires session: (User global variable) session ("sesname") = value: Store session variables,
You can also read this value session ("sesName") = EMPTY: Determines whether the session value is existed, ISempty (SESSION ("SESNAME")) = true | false: Determines whether the session value exists Session.Timeout = NUM: Set the presence of the session variable, unit minutes session.abandon: Clear all session variables session.Session ID: session variable ID serial number, read-only Application: (Application Global Variable) Application ("AppName") = Value : Store Application Values, or reads this value Application ("AppName") = EMPTY: Determines whether the application value is = true | false: Determine if the application value exists Two Method Application.lock: Application Variable Value locks to prevent the variable value application.Unlock: Application Variable value unlock, allowing change to change variables: session and application variables can be used to store arrays and system objects, the reference method is variable Name is equivalent to array name, but it is not possible to change its value, you need to use the temporary array to modify the value, then assign the structure of the session and Application Variables Global.asa file: <% @ language = "vbscript"%> <% sub Application_OnStart ... End Sub Sub Application_ONEND ... END SUB SUB SESSION_ONSTART ... END SUB SUB SUB SESSION_ONEND ... End Sub%> Server: Server.mAppath ("fileurl": Mapping file name The server site absolute address, PATH = Server.mappath (./) can get a virtual directory root path server.htmlencode ("S "): Convert to a string that can directly display the HTML format, such as: <,> and other Server.urlencode (" string "): Convert to browser address encoded set var = server.creatobject (" objName ": Created Object Variable Server.ScriptTimeout = Numseconds: ASP Program page Perform time limit, in seconds unit cookies: stored in the user's native variable, each cookie's maximum byte 4KB, up to 300 cookie 1.2MBRESPONSE.COOKIES (" Strcookiename ") = value: Store the cookie variable, you can also read this value response.cookies.
Strcookiename ") =" ": Judging whether it is empty response.cookies (" strcookiename "). Expires = Date: Variable validity period, with a day unit, less than the current time to expire Response.Cookies (cookie [(key) .attribute]) : Standard syntax ObjectContext control ASP transaction ObjectContext.ontransactionAbort: The abandoned transaction event is excited, ObjectContext.ontransactionCommit: ObjectContext.ontransactionCommit after the script is completed: The successful transaction event is excited, ObjectContext.Setabort occurs after the script is completed. give up one type of transaction ObjectContext.SetComplete: front cover any calls ObjectContext.SetAbort method is called Msgbox "string" / strName: VBscript balloon form Onsubmit event: written in the same page Function FormName_onsubmit () .. FormName_onsubmit = True / False..end function, page will execute the statement before commit, and determine whether the submission task is completed according to the return value.