My ASP generic interfaces interface (conn. asp) (zz)

Source: Internet
Author: User
Document directory
  • My ASP generic interfaces interface (conn. asp)
My ASP generic interfaces interface (conn. asp)
Introduction:
Generally, there are at least three things to do on the web site of the ASP technical architecture: 1. Create a data transfer interface; 2. Illegal strings in the previous address; 3.. The following examples are examples of how to complete these three tasks:
<! -- Metadata type = "typelib" file = "C: \ Program Files \ common files \ System \ ADO \ msado15.dll" -->

<%

Dim Conn, connstr


Checkquerystring 'invalid use of the "invalid signature character validity" process



'===================================' ====================

Sub openconn

On Error resume next

Dim DB


Set conn = server. Createobject ("ADODB. Connection ")

Connstr = "provider = sqloledb.1; persist Security info = false; user id = sa; initial catalog =" + SESSION ("catalog") + "; Data Source = (local ); pwd ="

The 'session ("catalog") variable is used to create multiple remote connections.



If conn. State = adstateclosed then

Conn. Open connstr

If err then

Call errormsg (7)

Response. End

End if

End if

End sub

'=======================================End sub ================ ==================




'===================================' ====================

Sub closeconn

If conn. State = adstateopen then

Conn. Close

End if

Set conn = nothing

End sub

'=======================================End sub ================ ==================




'====================================== Character legality ============ ========= sub checkquerystring

Dim QS, ERRC, III

Qs = request. servervariables ("QUERY_STRING ")

Dim nothis (18)

Nothis (0) = "Net user"

Nothis (1) = "xp_mongoshell"

Nothis (2) = "/Add"

Nothis (3) = "Exec % 20master. DBO. xp_mongoshell"

Nothis (4) = "net localgroup Administrators"

Nothis (5) = "select"

Nothis (6) = "count"

Nothis (7) = "ASC"

Nothis (8) = "char"

Nothis (9) = "mid"

Nothis (10) = "'"

Nothis (11) = ":"

Nothis (12) = """"

Nothis (13) = "insert"

Nothis (14) = "delete"

Nothis (15) = "Drop"

Nothis (16) = "truncate"

Nothis (17) = "from"

Nothis (18) = "Drop"

ERRC = false

For IIi = 0 to ubound (nothis)

If instr (QS, nothis (III) <> 0 then

ERRC = true

End if

Next

If ERRC then

Errormsg (8)

End if

End sub

'=====================================End sub ===================== ==================




'= ============

Sub errormsg (ID)

Response. Redirect (".../error. asp? Errorid = "& ID)

Response. End

End sub

'================================== End sub ======================== ==================

%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.