hostedit_state.asp

来自「一个非常优秀的自动建站程序」· ASP 代码 · 共 40 行

ASP
40
字号
<%
WebID = Request("WebID")
if (WebID="") then Response.Redirect ("error.asp?id=001")
%>
<!--#include file="top.asp"-->
<!--#include file="../checkpost.asp"-->
<%
'此模块是进行主机运行,停止和暂停操作
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select ServerID,WebState,HostIP from [Host_OK] where WebID=" & WebID
rs.open sql,conn,1,3
if rs.bof and rs.eof then Response.Redirect("error.asp?id=003")
Set Autohost = Server.CreateObject("autohost.Createhost")
Autohost.HostIp=rs("HostIp")
Autohost.HostPort=Port
Autohost.Guid=Guid
Autohost.HostAction="webState"'动作,主机状态设置命令
Autohost.HostIndex=rs("ServerID")'站点的INDEX
Autohost.HostState=Request.form("State")'要设置的站点状态
ReturnValue=Autohost.send'传递给服务器执行
set Autohost=nothing
'以下是检查服务器的返回值,因为服务器返回值里有控制符,所以这个只对返回值进行查找过滤处理
if instr(ReturnValue,"失败") then 
   Response.Redirect("error.asp?ID=012")
elseif instr(ReturnValue,"BUSING") then 
   Response.Redirect("error.asp?ID=016")
elseif instr(ReturnValue,"CLOSE") or ReturnValue="" then 
   Response.Redirect("error.asp?ID=017")
elseif instr(ReturnValue,"非法命令") then 
   Response.Redirect("error.asp?ID=019")
elseif instr(ReturnValue,"非法用户") then 
   Response.Redirect("error.asp?ID=020")
else
rs("WebState")=Request.form("State")
rs.update
rs.close
set rs = nothing
end if
Response.Redirect("UserHostEdit.asp?WebID=" & WebID)
%>

⌨️ 快捷键说明

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