Some HTML, JavaScript, ASP code worth collecting

xiaoxiao2021-03-06  51

1. CDONTS.NEWMAIL Component Instructions SET MailObject = Server.createObject ("cdonts.newmail") mailObject.from = "Send mailbox" MailObject.to = "Revenue Mailbox" MailObject.cc = "Cc) MailObject. BCC = "Secret mailbox" MailObject.Subject = "mail topic" MailObject.body = "mail" mailbject.mailformat = 0 'mail format, 0 is MIME format, 1 is text message MailObject.bodyFormat = 0' mail The format of the body, 0 indicates the html format, 1 means the importance of ordinary text MailObject.Importance = 1 'mail, 0 is the low importance, 1 means normal, 2 means high important MailObject.attachfile "attachment absolute path", "attachment Name "MailObject.send set mailObject = nothing2. Webpage is not cached response.expires = -1 response.expiresabsolute = now () - 1 response.cachecontrol =" no-cache "3. Client IP address Request.ServerVariables (" Remote_addr) 4. Method for recording the object: rs.movenext Moves the record pointer down the current location to move the logger from the current location to the top Rs.MoveFirst to move the record pointer to the first line of the data table Rs.MovelAst moves the record pointer to the last line RS.AbsolutePosition = n Move the record pointer to the data table Nth line rs.absolute = n Move the record pointer to the first line of the first line of the nth page RS.PageSize = n setting Each page is N record rs.PageCount Returns the total number RS.RecordCount Returns the total number of the total number rs.trib Returns the total number RS.BOF Returns the record pointer over the data table header, the true representation is whether false is RS.EOF Returns the record pointer. The True is deleted by the end of the data sheet. In addition to the current record, the record pointer does not move the rs.addnew to add the RS.AddNew to the data table Rs.Update update data sheet record 5. Random number INT INT ((Upper - lower bound 1) * RND lower bound) 6 Check the input function function check_input (input) INPUT = trim (input) 'Removing extra space INPUT = Server.htmlencode (Input)' Convert HTMLINPUT = Replace (Input, Chr (39), "')' conversion half angle single quotes INPUT = Replace (INPUT, CHR (34), "") 'conversion half angle double quotation number checkinput = INPUTEND FUNCTION7. Connection Access Database Method 1: Set Conn = Server.createObject ("AdoDb.Connection" Conn.open

Driver = {Microsoft Access Driver (* .mdb)}; DBQ = "& Server.mappath (" DATA.MDB ") Method 2: set conn = server.createObject (" adoDb.connection "conn.open" provike "provider = Microsoft. Jet.Oledb.4.0; data source = "& server.mappath (" data.mdb ") 1. ΟncοntextMenu =" window.event.returnvalue = false "will thoroughly shield the mouse button

NO can be used for Table2. Cancel to prevent copy 3. οnpaste = "return false" is not allowed to paste 4. οncοpy = "Return False;" oncut = "Return False; "Prevent copy 5. IE IE addressed to my own icon 6. can be available The icon is displayed in the clip 7. Close input method 8. Always bring the frame