<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("cansysteminfo")="" Then
	ef=True
	ec="您没有此操作的权限。"
end if
if not ef then
If Len(Application("Domain_Agent_url_6"))<10 Then
	ef=True
	ec="API6接口的信息还没有设置。"
end if
end if

if not ef Then

on error resume next

api6checkurl=Application("Domain_Agent_url_6")&"/api/freehost.asp"
postbody="client="&Application("Domain_Agent_username_6")&"&checksum="&Application("Domain_Agent_md5_6")&"&optype=systemtest"
	Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
xml.setTimeouts FreeHost_t1, FreeHost_t2, FreeHost_t3, FreeHost_t4
xml.Open "POST",api6checkurl, False
xml.setRequestHeader "Content-Length",Len(postbody)
xml.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
xml.send postbody
returnstr = bytes2BSTR(xml.responsebody)
	Set xml = Nothing

response.write "<br><br>返回信息:"&returnstr&"<br><br>向API提交的信息:"&postbody

'response.end


if err.number<>0 then Response.Write "出现错误："&err.description


if instr(err.description,"could not be resolved")>0 then%>
在主控服务器上，无法解析控域名：<a href="<%=Application("Domain_Agent_url_6")%>"><%=Application("Domain_Agent_url_6")%></a><br>
请在主控服务器上ping 此域名试试。
<%end if%>

<%if instr(retstr," 404 ")>0 then%>
<font color=red>错误：API文件没找到(<%=api6checkurl%>)。</font><br>
<%
end if

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