SoFunction
Updated on 2025-04-14

ASP essence source code collection (five-year summary) page 15/20


Server-side script:
<%………
set conn= ("")
"DSN=name;UID=XXXX;PWD=XXXX;"
set rs=("")
(“select ……”),conn,1,1
………….%> //Interact with the database
HTML page encoding:
<HTML>
………
<FORM ID=printinfo NAME="printinfo" >
<INPUT type="button" value="Print>>" id=print name=print > //Calling the print function
<INPUT type=hidden id=text1 name=label value=<%=………%>> //Save data transmitted from the server side
………
</HTML>
Meizz (Plum Blossom Rain) Treasure Box (1) (all good things)
1. oncontextmenu="=false"
Right mouse button on the bottom block
<table border oncontextmenu=return(false)><td>no</table>
Available for Table
2. <body onselectstart="return false"> Cancel
Select and prevent copying
3. onpaste="return false"
No sticking allowed
4. oncopy="return false;" oncut="return false;"
Prevent copying
5. <link rel="Shortcut Icon" href=""> Front of IE address bar
Change to your own icon
6. <link rel="Bookmark" href=""> Can be found in favorites
Show your icon
7. <input style="ime-mode:disabled">
Close input method
8. Always carry a frame
<script language="JavaScript"><!--
if (window == top) = "";
//For the frame web page
// --></script>
9. Prevent frames from being
<SCRIPT LANGUAGE=JAVASCRIPT><!--
if ( !=
)=;
// --></SCRIPT>
10. <noscript><iframe src=../../*.html></iframe></noscript> Net
Pages will not be saved as
11. <input type=button value=View web page source code
onclick=" = 'view-source:'+
'/'">
12. How to check whether the client uses the agent through Asp
<% if ("HTTP_X_FORWARDED_FOR")<>""
then
"<font color=#FF0000>You have passed the proxy server,"&
_
"The real IP is
"&("HTTP_X_FORWARDED_FOR")
end if
%>
13. Get the absolute position of the control
//Javascript
<script language="Javascript">
function getIE(e){
var t=;
var l=;
while(e=){
t+=;
l+=;
}
alert("top="+t+"\nleft="+l);
}
</script>
//VBScript
<script language="VBScript"><!--
function getIE()
dim t,l,a,b
set a=.img1
t=.
l=.
while <>"BODY"
set a =
t=t+
l=l+
wend
msgbox "top="&t&chr(13)&"left="&l,64,"get the position of the control"
end function
--></script>
14. The cursor is stopped at the end of the text box
<script language="javascript">
function cc()
{
var e = ;
var r =();
('character',);
(true);
();
}
</script>
<input type=text name=text1 value="123" onfocus="cc()">
15. Determine the source of the previous page
asp:
("HTTP_REFERER")
javascript:

16. Minimize, maximize, close windows
<object id=hh1
class>
<param name="Command" value="Minimize"></object>
<object id=hh2
class>
<param name="Command" value="Maximize"></object>
<OBJECT id=hh3
class>
<PARAM NAME="Command" VALUE="Close"></OBJECT>
<input type=button value=minimize onclick=()>
<input type=button value=maximize onclick=()>
<input type=button value=close onclick=()>
This example applies to IE
17.
<%
'Define some constants for database connection
Const adOpenForwardOnly = 0 'The cursor only browses the history forward and does not support it
Pagination, Recordset, BookMark
Const adOpenKeyset = 1 'keyset cursor, other users say to the record
Modifications made will be reflected in the record set, but other users add or delete records will not be reflected in the
Record set. Supports pagination, Recordset, BookMark
Const adOpenDynamic = 2 'Dynamic cursor has the strongest function, but it consumes resources
The most. The changes, addition or deletion of records by users will be reflected in the record set
middle. Support full-featured browsing (ACCESS does not support).
Const adOpenStatic = 3 'static cursor, just a fast data
The user's modifications to the record, adding or deleting records will not be reflected in the record set.
. Supports forward or backward movement
Const adLockReadOnly = 1 'Lock type, default, read-only, not
Any modifications can be made
Const adLockPessimistic = 2 'Lock the record immediately when editing, the most safe
A complete way
Const adLockOptimistic = 3 'Lock is only locked when the Update method is called
Set the record set, and other previous operations can still change, insert and delete the current record
Removal
Const adLockBatchOptimistic = 4 'The record will not be locked when editing, and
Changes, inserts, and deletion are done in batch mode
Const adCmdText = &H0001
Const adCmdTable = &H0002
%>
Meizz (Plum Blossom Rain) Treasure Box (Two)
----------------------------
Previous page1234567891011121314151617181920Next pageRead the full text