|
|
- <%@LANGUAGE="VBSCRIPT"%>
- <% if we(request("ac")) = "1" then %>
- <% = dosql() %>
- <% elseif we(request("ac")) = "2" then %>
- <% = getstr() %>
- <% elseif we(request("ac")) = "3" then %>
- <% = now() %>
- <% else %>-1
- <% end if %>
- <%
- Function getstr()
- set conn = Server.CreateObject("ADODB.Connection")
- on error resume next
- conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/access_db/data.mdb") '这里设置数据库名,要和下面的一样
- if err then
- response.write ("1") '数据库不存在
- exit Function
- end if
- set rs = Server.CreateObject("ADODB.Recordset")
- sql = ys(request("SQL"))
- rs.Open sql, conn, 3
- if err then
- response.write ("2") 'SQL语句出错
- exit Function
- end if
- rs.MoveFirst
- For Each varItem In rs.Fields
- getstr = getstr & varItem.name & "々"
- Next
- getstr = getstr & "☆"
- Do While NOT rs.EOF
- For Each varItem In rs.Fields
- getstr = getstr & varItem.value & "々"
- Next
- getstr = getstr & "☆"
- rs.MoveNext
- Loop
- Set rs = Nothing
- set conn = Nothing
- End Function
- Function dosql()
- set conn = Server.CreateObject("ADODB.Connection")
- on error resume next
- conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/access_db/data.mdb") '这里设置数据库名,要和上面的一样
- if err then
- response.write ("1") '数据库不存在
- exit Function
- end if
- set rs = Server.CreateObject("ADODB.Recordset")
- sql = ys(request("SQL"))
- rs.Open sql, conn, 3
- if err then
- response.write ("2") 'SQL语句出错
- exit Function
- end if
- Set rs = Nothing
- set conn = Nothing
- dosql = 0
- End Function
-
- Function we(b)
- dim f, g, h , k, kl, key
- key = "12,12,12,12,12,12" '这里设置密码,要以管理端和客户端相同,要以这种格式,只能是数字
- k = split(key,",")
- f = split(b,"A")
- h = 0
- For g = LBound(f) To UBound(f)
- kl = cint(k(h))
- If f(g) <> "" Then
- we=we & chr(f(g) xor kl)
- End If
- if h < UBound(k) Then
- h = h + 1
- Else
- h = 0
- End If
- Next
- we = we
- end Function
- Function ys(w)
- dim fen,shi,shu
- fen=split(we(w),"☆々☆")
- shi=formatdatetime(fen(0),0)
- if datediff("s",shi,time()) < 90 then
- shu=fen(1)
- Else
- response.write ("3") '命令超时
- end if
- ys=shu
- End Function
- %>
复制代码 上面是一个asp页面的代码
我空间后台已经打开支持acc数据库 并且该目录也开放写入权限
但就是不行... 我本机就没问题... |
|