📄 hostrun.asp
字号:
<%
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,FtpName 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")
ServerID=rs("ServerID")
HostIp=rs("HostIp")
FtpName=rs("FtpName")
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=2'2为运行,4为停止,6为暂停
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
Set Autohost = Server.CreateObject("autohost.Createhost")
Autohost.HostIp=HostIp
Autohost.HostPort=Port
Autohost.Guid=Guid
Autohost.HostAction="startftp"'动作,停止运行FTP站点
Autohost.Hostuser=FtpName'FTP用户名
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")
end if
rs("WebState")=2
rs.update
rs.close
set rs = nothing
end if
Response.Redirect("hostlist.asp")
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -