<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("VPSAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(session("VPSAUID"))  Then
	ef=True
	ec="osid应该是数字！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsphVPS = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_VPS where id='"&session("VPSAUID")&"'"
	dsphVPS.Open Sql,conn,1,3
if dsphVPS.Eof then
	ef=True
	ec="不存在的数据库产品ID！"
end if
end if

if not ef then
	Set dsVPSpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_VPSProductlist where VPStype='"&dsphVPS("VPStype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsVPSpdlist.Open Sql,conn,1,1
if dsVPSpdlist.Eof then
	ef=True
	ec="产品不存在！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerVPSlist where id='"&dsphVPS ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
else
isONEip=dsserver("isONEip")	
end if
end If

if not ef then
Set dsVPSip = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_VPS_IP where ipbyid=0 and VPSID="&dsphVPS("id")
		dsVPSip.Open Sql,conn,1,1
If  not dsVPSip.eof then
IP=dsVPSip("IP")
IPmask=dsVPSip("IPmask")
IPgateway=dsVPSip("IPgateway")
IPdns1=dsVPSip("IPdns1")
IPdns2=dsVPSip("IPdns2")
'dsVPSip.close
Else
	ef=True
	ec="这个VPS没有分配IP资源,请联系管理员处理！"
end If
end If

if not ef Then
if isONEip=true then
	Set dsPORTserver = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_ServerPORTlist where id='"&dsserver("useportserver")&"'"
		dsPORTserver.Open Sql,conn,1,3
If dsPORTserver.Eof Then
	ef=True
	ec="PORT服务器不存在。"
Else
IPopen=dsPORTserver("ip")
end If
end If
end if


if not ef Then

EndIP=IP
portstart=3389
If isONEip Then
IPopenAry=Split(IPopen,",")
EndIP=IPopenAry(0)
portstart=dsVPSip("portstart")
End If

%>
<!--#include virtual="/inc-freehost-function/template-vpsadm-top.asp"-->
　云服务器自助管理


<br>
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR align="center">
      <TD height="35" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">远程桌面连接系统：</font></TD>
    </TR>


    <TR>
      <TD height="100" align="center" vAlign=middle bgColor=#FFFFFF>
        当您预装的操作系统为windows 2003或windows 2008时，您可以使用本功能连接远程桌面<br>
        （本功能只能在IE中使用）<br>
您还需要在IE提示“远程桌面服务ActiveX客户端”时选允许。<br>
如果下面内容长时间空白可能是无法连接云服务器，或操作系统不是windows系统。<br>
        <br>        </TD>
    </TR>
    <TR>
      <TD height="30" align="center" vAlign=middle bgColor=#FFFFFF>



<object classid="clsid:7584c670-2274-4efb-b00b-d6aaba6d3850" id="MsRdpClient" classid="CLSID:7584c670-2274-4efb-b00b-d6aaba6d3850" codebase="msrdp.cab#version=5,2,3790,0" width="800" height="600">

    </object>




    </object>
    <script language="javascript" type="text/javascript">
        var MsRdpClient = window.document.getElementById("MsRdpClient");
        MsRdpClient.DesktopWidth = "800";  //远程桌面的宽和高
        MsRdpClient.DesktopHeight = "600";
        MsRdpClient.FullScreen = "false";
        MsRdpClient.server = "<%=EndIP%>";
		MsRdpClient.AdvancedSettings2.RDPPort = "<%=portstart%>";
        MsRdpClient.UserName = "Administrator";
        MsRdpClient.AdvancedSettings2.ClearTextPassword = "";
        MsRdpClient.AdvancedSettings2.RedirectDrives = "FALSE";
        MsRdpClient.AdvancedSettings2.RedirectPrinters = "FALSE";
        MsRdpClient.AdvancedSettings2.RedirectPorts = "FALSE";
        MsRdpClient.AdvancedSettings2.RedirectSmartCards = "FALSE";
        MsRdpClient.Connect();
    </script>















	  </TD>
    </TR>


</TABLE>
<br>
<br>
</form>

　<a href="selfVPSmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-vpsadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
