<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canmyserver")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="ID应该是数字！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsHostserver = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&Request("id")&"' and (agent1='"&session("agentusername")&"' or agent2='"&session("agentusername")&"')"
		dsHostserver.Open Sql,conn,1,3
If dsHostserver.Eof Then
	ef=True
	ec="服务器不存在。"
end if
end if

if not ef then
URL=dsHostserver("site")
FreeHostsharekey=dsHostserver("FreeHostsharekey")
Response.Write SystemTest(URL,FreeHostsharekey)

if session("servertype")="Microsoft-IIS/7.0" Then
'iis7
dsHostserver("iisver")=7
dsHostserver.update
End If

if session("servertype")="Microsoft-IIS/8.0" Or session("servertype")="Microsoft-IIS/8.5" Then
'iis8
dsHostserver("iisver")=8
dsHostserver.update
'response.write session("servertype")
End If

end if
if ef then
Response.Redirect "e.asp?e="&ec
end if

Function SystemTest(URL,FreeHostsharekey)
Set MaintoCSCom=Server.CreateObject("www.7i24.com")
RetInfo=MaintoCSCom.DOHTTPSSL(Url&"?",FreeHostsharekey," ",FreeHost_t1,FreeHost_t2,FreeHost_t3,FreeHost_t4)
Set MaintoCSCom =Nothing
SystemTest=RetInfo
End Function
%>