ip.asp

来自「DbAnyWhere开发套件」· ASP 代码 · 共 35 行

ASP
35
字号
<%
dim conn,DBPath
dim remote_ip

'获取提交内容
com_id=request("com_id")
rw_type=request("rw_type")
vip=Request.ServerVariables("Remote_Addr")

DBPath = Server.MapPath("ip.mdb")
Connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& DBPath
Set conn = Server.CreateObject("ADODB.Connection")
Conn.open Connstr
set Rs = Server.CreateObject("ADODB.Recordset")

if rw_type="2" then
   sql="select remote_ip from db_ip where com_id=" &"'"&com_id &"'"
   Rs.open sql,conn,1,1
   remote_ip=rs("remote_ip")      
   Rs.close
  
end if

if rw_type="1" then
   sql="select remote_ip from db_ip where com_id="&"'"&com_id&"'"
   Rs.open sql,conn,3,2
   rs("remote_ip") =vip
   Rs.update
   Rs.close
end if

conn.Close
set conn=nothing
%>
<%=remote_ip%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?