Cubbybulin
asked on
Remote Desktop Connection Help Please!
I would like to add a remote desktop connection to my website, which works now, if I put the IP address of the server in the box. I dont want to reveal the IP address, so is it possible, that the initial value would be like "Server" and then when people push the button, it would go to the IP address I can specify? (here i put 123.123.123.123 for the ip address, which i dont want to show, but i want it to go there) Thanks!
Here is my code:
<html>
<head>
<title>Remote Desktop Web Connection</title>
<style type="text/css" media="screen">
p { color:"#000000"; font-family: "Verdana, Arial, Helvetica"; font-size:"65%"}
h1 { font-size: 100%; font-family: verdana, arial, helvetica; font-weight: bold;
     margin-top: 0em;}
p.indent { margin-left: 3em; margin-top: .5em; line-height: 1.25em; margin-bottom: .2em; margin-right: 1em;}
.button {
   FONT-FAMILY: Verdana, Helvetica, Arial, San-Serif;
   font-weight:normal;
   font-size:70%;
   color:#000000;
   background-color:#ffffff;
   border-color:#6699ff;
   margin-top:6pt;
   margin-left: .5em;
}
.topspace {margin-top: .08em; }
</style>
</head>
<body bgcolor="#ffffff">
<script language="vbscript">
<!--
const L_FullScreenWarn1_Text = "Your current security settings do not allow automatically switching to fullscreen mode."
const L_FullScreenWarn2_Text = "You can use ctrl-alt-pause to toggle your remote desktop session to fullscreen mode"
const L_FullScreenTitle_Text = "Remote Desktop Web Connection "
const L_ErrMsg_Text     = "Error connecting to remote computer: "
const L_PlatformCheck_ErrorMessa ge = "The Remote Desktop Web connection ActiveX control can only run in the 32-bit version of Internet Explorer."
' error messages
const L_RemoteDesktopCaption_Err orMessage = Â "Remote Desktop Connection"
const L_DisconnectedCaption_Erro rMessage = Â "Remote Desktop Disconnected"
const L_ErrConnectCallFailed_Err orMessage = Â "An error occurred when the client attempted to connect to the remote computer. Check your system memory and then try the connection again."
const L_DisconnectRemoteByServer _ErrorMess age = "The remote computer has ended the connection."
const L_LowMemory_ErrorMessage = "The local computer is low on memory. Close some programs, and then connect to the remote computer again."
const L_SecurityErr_ErrorMessage = "Because of a security error, the client could not connect to the remote computer. Verify that you are logged on to the network, and then try connecting again."
const L_BadServerName_ErrorMessa ge = "The specified remote computer could not be found. Verify that you have typed the correct computer name or IP address, and then try connecting again."
const L_ConnectFailedProtocol_Er rorMessage = "Because of a protocol error, the client could not connect to the remote computer. Please try connecting to the remote computer again. If the client still fails to connect, contact your network administrator."
const L_CannotLoopBackConnect_Er rorMessage = "The client could not connect. You cannot connect to the console from a console session of the same computer."
const L_NetworkErr_ErrorMessage = "The connection was ended because of a network error. Please try connecting to the remote computer again."
const L_InternalErr_ErrorMessage = "An internal error has occurred."
const L_NotResponding_ErrorMessa ge = "The client could not connect to the remote computer. Remote connections might not be enabled or the computer might be too busy to accept new connections.It is also possible that network problems are preventing your connection.Please try connecting again later. If the problem continues to occur, contact your administrator."
const L_VersionMismatch_ErrorMes sage = "Client and server versions do not match. Please upgrade your client software and then try connecting again."
const L_EncryptionError_ErrorMes sage = "Because of an error in data encryption, this session will end. Please try connecting to the remote computer again."
const L_ProtocolErr_ErrorMessage = "Because of a protocol error, this session will be disconnected. Please try connecting to the remote computer again."
const L_IllegalServerName_ErrorM essage = "The specified computer name contains invalid characters. Please verify the name and try again."
const L_ConnectionTimeout_ErrorM essage = "The remote connection has timed out. Please try connecting to the remote computer again."
const L_DisconnectIdleTimeout_Er rorMessage = "The remote session was ended because the idle timeout limit was reached. This limit is set by the server administrator or by network policies."
const L_DisconnectLogonTimeout_E rrorMessag e ="The remote session ended because the total logon time limit was reached. This limit is set by the server administrator or by network policies."
const L_ProtocolErrWITHCODE_Erro rMessage  = "Client disconnected due to internal protocol error: "
const L_LicensingTimeout_ErrorMe ssage = "A licensing error occurred while the client was attempting to connect (Licensing timed out).Please try connecting to the remote computer again."
const L_LicensingNegotFailed_Err orMessage = "The remote computer disconnected the session because of an error in the licensing protocol.Please try connecting to the remote computer again or contact your server administrator."
const L_DisconnectRemoteByServer Tool_Error Message = "The remote session to the remote computer was ended by means of an administration tool.Your administrator might have ended your connection."
const L_LogoffRemoteByServer_Err orMessage = "The remote session was disconnected because your session was logged off at the remote computer.Your administrator or another user might have ended your connection."
const L_DisconnectByOtherConnect ion_ErrorM essage = "The remote session was disconnected because another user has connected to the session."
const L_ConnectionBroken_ErrorMe ssage  = "The connection to the remote computer was broken. This may have been caused by a network error.Please try connecting to the remote computer again."
const L_ServerOutOfMemory_ErrorM essage = "The connection was disconnected because the remote computer is low on memory."
const L_LicenseInternal_ErrorMes sage = "The remote session was disconnected because there was an internal error in the remote computer's licensing protocol."
const L_NoLicenseServer_ErrorMes sage = "The remote session was disconnected because there are no Terminal Server License Servers available to provide a license.Please contact the server administrator."
const L_NoLicense_ErrorMessage = "The remote session was disconnected because there are no Terminal Server client access licenses available for this computer.Please contact the server administrator."
const L_LicenseBadClientMsg_Erro rMessage = "The remote session was disconnected because the remote computer received an invalid licensing message from this computer."
const L_LicenseHwidDoesntMatch_E rrorMessag e = "The remote session was disconnected because the Terminal Server client access license stored on this computer has been modified."
const L_BadClientLicense_ErrorMe ssage = "The remote session was disconnected because the Terminal Server client access license stored on this computer is in an invalid format."
const L_LicenseCantFinishProtoco l_ErrorMes sage = "The remote session was disconnected because there were network problems during the licensing protocol.Please try connecting to the remote computer again."
const L_LicenseClientEndedProtoc ol_ErrorMe ssage = "The remote session was disconnected because the client prematurely ended the licensing protocol."
const L_LicenseBadClientEncrypti on_ErrorMe ssage = "The remote session was disconnected because a licensing message was incorrectly encrypted."
const L_CantUpgradeLicense_Error Message = "The remote session was disconnected because the local computer's client access license could not be upgraded or renewed.Please contact the server administrator."
const L_LicenseNoRemoteConnectio ns_ErrorMe ssage = "The remote session was disconnected because the remote computer is not licensed to accept remote connections.Please contact the server administrator."
const L_DecompressionFailed_Erro rMessage = "The remote session was disconnected because of a decompression failure at the client side. Please try connecting to the remote computer again."
const L_ServerDeniedConnection_E rrorMessag e ="The client could not establish a connection to the remote computer.The most likely causes for this error are:1) Remote connections might not be enabled at the remote computer.2) The maximum number of connections was exceeded at the remote computer.3) A network error occurred while establishing the connection."
const L_ControlLoadFailed_ErrorM essage= "Remote Desktop Web Connection ActiveX control could not be installed. A connection cannot be made without a working installed version of the control. Please contact the server administrator."
const L_InvalidServerName_ErrorM essage = "An invalid server name was specified."
sub window_onload()
  if not LCase(Navigator.CpuClass) = "x86" then
   msgbox L_PlatformCheck_ErrorMessa ge
  end if
  if not autoConnect() then
    Document.all.editServer.Fo cus
  end if
end sub
function autoConnect()
   Dim sServer
   Dim iFS, iAutoConnect
   sServer = getQS ("Server")
   iAutoConnect = getQS ("AutoConnect")
   iFS = getQS ("FS")
   if NOT IsNumeric ( iFS ) then
     iFS = 0
   else
     iFS = CInt ( iFS )
   end if
   if iAutoConnect <> 1 then
     autoConnect = false
     exit function
   else
     if iFS < 0 or iFS >= Document.all.comboResoluti on.options .length then
        iFS = 0
     end if
     if IsNull ( sServer ) or sServer = "" then
        sServer = window.location.hostname
     end if
     Document.all.comboResoluti on.selecte dIndex   = iFS
     Document.all.Server.value = sServer
     btnConnect ()
     autoConnect = true
   end if
end function
function getQS ( sKey )
   Dim iKeyPos, iDelimPos, iEndPos
   Dim sURL, sRetVal
   iKeyPos = iDelimPos = iEndPos = 0
   sURL = window.location.href
   if sKey = "" Or Len(sKey) < 1 then
     getQS = ""
     exit function
   end if
   iKeyPos = InStr ( 1, sURL, sKey )
   if iKeyPos = 0 then
     sRetVal = ""
     exit function
   end if
   iDelimPos = InStr ( iKeyPos, sURL, "=" )
   iEndPos = InStr ( iDelimPos, sURL, "&" )
   if iEndPos = 0 then
     sRetVal = Mid ( sURL, iDelimPos + 1 )
   else
     sRetVal = Mid ( sURL, iDelimPos + 1, iEndPos - iDelimPos - 1 )
   end if
   getQS = sRetVal
end function
sub checkClick
   if Document.all.Check1.Checke d then
     Document.all.tableLogonInf o.style.di splay = ""
     Document.all.editUserName. Disabled = false
     Document.all.editDomain.Di sabled = false
   else
     Document.all.tableLogonInf o.style.di splay = "none"
     Document.all.editUserName. Disabled = true
     Document.all.editDomain.Di sabled = true
   end if
end sub
sub OnControlLoadError
  msgbox L_ControlLoadFailed_ErrorM essage,0,L _RemoteDes ktopCaptio n_ErrorMes sage
end sub
sub OnControlLoad
  set Control = Document.getElementById("M sRdpClient ")
  if Not Control is Nothing then
   if Control.readyState = 4 then
     Document.all.connectButton .disabled = FALSE
   end if
  end if
end sub
sub BtnConnect
  Dim serverName
  'server
  if not Document.all.Server.value = "" then
   serverName = Document.all.Server.value
  else
   serverName = Document.location.hostname
  end if
 Â
  serverName = trim(serverName)
 Â
  On Error Resume Next
  MsRdpClient.server = serverName
  If Err then
   msgbox L_InvalidServerName_ErrorM essage,0,L _RemoteDes ktopCaptio n_ErrorMes sage
   Err.Clear
   exit sub
  end if
  On Error Goto 0
 Â
  'serverName name text
  Document.all.srvNameField. innerHtml = serverName
 Â
  'Username/Domain
  if Document.all.CheckBoxAutoL ogon.check ed then
   MsRdpClient.UserName = Document.all.UserName.Valu e
   MsRdpClient.Domain = Document.all.Domain.Value
  end if
 Â
  'Resolution
  MsRdpClient.FullScreen = FALSE
  select case document.all.comboResoluti on.value
  case "1"
   MsRdpClient.FullScreen = TRUE
   resWidth  = screen.width
   resHeight = screen.height
  case "2"
   resWidth  = "640"
   resHeight = "480"
  case "3"
   resWidth  = "800"
   resHeight = "600"
  case "4"
   resWidth  = "1024"
   resHeight = "768"
  case "5"
   resWidth  = "1280"
   resHeight = "1024"
  case "6"
   resWidth  = "1600"
   resHeight = "1200"
  end select
  MsRdpClient.DesktopWidth = resWidth
  MsRdpClient.DesktopHeight = resHeight
 Â
 Â
  MsRdpClient.Width = resWidth
  MsRdpClient.Height = resHeight
 Â
  'Device redirection options
  MsRdpClient.AdvancedSettin gs2.Redire ctDrives   = FALSE
  MsRdpClient.AdvancedSettin gs2.Redire ctPrinters  = TRUE
  MsRdpClient.AdvancedSettin gs2.Redire ctPorts    = FALSE
  MsRdpClient.AdvancedSettin gs2.Redire ctSmartCar ds = FALSE
 Â
  'FullScreen title
  MsRdpClient.FullScreenTitl e = L_FullScreenTitle_Text & "(" & serverName & ")"
 Â
  'Display connect region
  Document.all.loginArea.sty le.display = "none"
  Document.all.connectArea.s tyle.displ ay = "block"
 Â
  'Connect
  MsRdpClient.Connect
end sub
-->
</script>
<!-- Â
-->
<!-- =========================L OGIN AREA Â ==========================
-->
<div id=loginArea>
<font size="4">
<img border="0" src="win2000l.gif" id=leftalign align="left" width="124" height="123" hspace="10"></font></font> <font id=Tahoma1 face="Tahoma" size="1"><br>
</font><font size="6" id=Tahoma2 face="Tahoma">
<img border="0" src="win2000r.gif" hspace="0" vspace="7" width="145" height="45"></font><font id=Tahoma3 face="Tahoma" size="4"><br>
</font><b>
<font id=Tahoma4 face="Tahoma" size="4"><ID id=bigtitle>Remote Desktop Web Connection </ID></font></b><p> < /p>
<table border="0" width="640" cellspacing="0" cellpadding=0 style="margin-top: -1em;">
<!-- Graphic bar row  -->
<tr>
<td width="50%"></td>
<td colspan=3 align="left" valign="middle">
<img src="bluebarh.gif" alt="blue bar graphic" width="325" height="8"></td>
</tr>
<!-- Row 1 -->
  <tr>
<!-- Column 1 spans 4 rows -->
  <td valign="top" width="50% "rowspan=4>
     <p class=indent>
        <ID id=remotecomputername>Clic k <b>Connect</b>.</ID></p>
     <p class=indent><ID id=helpfultip1>When the connection page opens, you can add it to your Favorites for easy connection to the same computer.</ID></p>
  </td>
<!-- Column 2 spans 4 rows-->
   <td rowspan=4 valign="top" align="left">
  <img src="bluebarv.gif" alt="blue bar graphic" border=0 width="8" height="330">
   </td>
  Â
<!-- Column 3 --> Â Â Â Â Â
  <td id="ServerNameKeyWidth" style="width:10%;" valign="middle">  Â
     <label id=ServerNameKey accessKey="S" for="editServer">
     <br><p align="right"> <ID id=ServerName><u>S</u>erve r:</ID></l abel></p>
     </td>
     Â
<!-- Column 4 --> Â Â Â Â Â Â
   <td id="ServerKeyWidth" width="40%" valign="bottom">
   <br> <input type="text" name="Server" size="41" id="editServer" value="123.123.123.123">
  Â
   </td>
   </tr>
<!-- Row 2 -->
<tr>
<!-- Column 3 -->
<td valign="middle">
<p align="right"><label id=sizeKey accessKey="Z" for="comboRes" class="sizespace"><ID id=size>Si<u>z</u>e:</ID>< /p></td>
<!-- Column 4 -->
<td valign="bottom"> &nbs p;<select size="1" name="comboResolution" id=comboRes class="topspace">
       <option selected value="1"><ID id=option1>Full-screen</ID ></option>
       <option value="2"><ID id=option2>640 by 480</ID></option>
       <option value="3"><ID id=option3>800 by 600</ID></option>
       <option value="4"><ID id=option4>1024 by 768</ID></option>
       <option value="5"><ID id=option5>1280 by 1024</ID></option>
       <option value="6"><ID id=option6>1600 by 1200</ID></option>
      </select> </label>
</td>
</tr>
<!-- Row 3 -->
<tr>
<!-- Column 3 -->
<td></td>
<!-- Column 4 -->
<td align="bottom"> Â Â Â Â Â Â Â
   <p class=topspace> <inpu t type="checkbox" name="CheckBoxAutoLogon" ID=Check1 value="OFF" onclick = "checkClick"><label for="Check1" ID=SendLogonKey accesskey="l"><ID id=logoninfo>Send <u>l</u>ogon information for this connection </ID></lab el><br>
   Â
<span ID="tableLogonInfo" style="display: none">
      <p align="right" class=topspace>
        <br>
        <ID id=usernamelabel><u>U</u>s er na me:</ID>
        <label id=UserNameKey accessKey="U" for="editUserName"><input type="text" name="UserName" id=editUserName size="25"></label><br>
        <ID id=domainlabel><u>D</u>oma in:</ID>
     <label id=editDomainKey accessKey="D" for="editDomain">
     <input type="text" name="Domain" id=editDomain size="25"></label></p></sp an>  Â
     <input type="submit" id=connectbutton value="Connect" disabled="TRUE" name="ButtonLogin" OnClick=BtnConnect class="button">
</td>
</tr>
<!-- Row 4 -->
<tr>
<!-- Column 3 -->
<td  height="215"> </td>
<!-- Column 4 -->
<td> </td>
</tr>
Â
  Â
</table>
</div>
<!-- ========================== ======= LOGIN FORM =================
-->
<!-- ========================== ======= CONNECT ====================
-->
<div id=connectArea style="display: none">
<center>
    <table>
    <tr>
    <OBJECT language="vbscript" ID="MsRdpClient"
    onerror="OnControlLoadErro r"
    onreadystatechange="OnCont rolLoad"
    CLASSID="CLSID:7584c670-22 74-4efb-b0 0b-d6aaba6 d3850"
    CODEBASE="msrdp.cab#versio n=5,2,3790 ,0"
    WIDTH=<% resWidth = Request.QueryString("rW")
      if  resWidth < 200 or resWidth > 1600 then
        resWidth = 800
      end if
      Response.Write resWidth %>
    HEIGHT=<% resHeight = Request.QueryString("rH")
      if  resHeight < 200 or resHeight > 1200 then
        resHeight = 600
      end if
      Response.Write resHeight %>>
    </OBJECT>
    </tr>
    <tr>
    <br>
    <font size="1" color="#000000" id="srvfontname" face="Verdana, Arial, Helvetica">
    <div id=connectDisplay style="display:none">
    <ID id=loggedinsrv>Connected to </ID><i><span id="srvNameField"></span>< /i></font> <br></div>
    </tr>
   Â
<script language="VBScript">
<!--
sub ReturnToConnectPage()
  Window.Navigate("Default.h tm")
end sub
sub MsRdpClient_OnConnected()
  Document.All.connectDispla y.style.di splay = "block"
end sub
sub MsRdpClient_OnDisconnected (disconnec tCode)
  extendedDiscReason = MsRdpClient.ExtendedDiscon nectReason
  majorDiscReason = disconnectCode And &hFF
  if (disconnectCode = &hB08 or majorDiscReason = 2 or majorDiscReason = 1) and not (extendedDiscReason = 5) then
   'Switch back to login area
   ReturnToConnectPage
   exit sub
  end if
 Â
  errMsgText = L_DisconnectRemoteByServer _ErrorMess age
  if not extendedDiscReason = 0 then
   'Use the extended disconnect code
   select case extendedDiscReason
   case 0  errMsgText  = ""
   case 1  errMsgText  = L_DisconnectRemoteByServer Tool_Error Message
   case 2  errMsgText  = L_LogoffRemoteByServer_Err orMessage
   case 3  errMsgText  = L_DisconnectIdleTimeout_Er rorMessage
   case 4  errMsgText  = L_DisconnectLogonTimeout_E rrorMessag e
   case 5  errMsgText  = L_DisconnectByOtherConnect ion_ErrorM essage
   case 6  errMsgText  = L_ServerOutOfMemory_ErrorM essage
   case 7  errMsgText  = L_ServerDeniedConnection_E rrorMessag e
   case 256 errMsgText  = L_LicenseInternal_ErrorMes sage
   case 257 errMsgText  = L_NoLicenseServer_ErrorMes sage
   case 258 errMsgText  = L_NoLicense_ErrorMessage
   case 259 errMsgText  = L_LicenseBadClientMsg_Erro rMessage
   case 260 errMsgText  = L_LicenseHwidDoesntMatch_E rrorMessag e
   case 261 errMsgText  = L_BadClientLicense_ErrorMe ssage
   case 262 errMsgText  = L_LicenseCantFinishProtoco l_ErrorMes sage
   case 263 errMsgText  = L_LicenseClientEndedProtoc ol_ErrorMe ssage
   case 264 errMsgText  = L_LicenseBadClientEncrypti on_ErrorMe ssage
   case 265 errMsgText  = L_CantUpgradeLicense_Error Message
   case 266 errMsgText  = L_LicenseNoRemoteConnectio ns_ErrorMe ssage
   case else errMsgText = L_ErrMsg_Text
   end select
   if extendedDiscReason > 4096 then
     errMsgText = L_ProtocolErrWITHCODE_Erro rMessage  & errMsgText
   end if
  else
   ' no extended error information, use the disconnect code
   select case disconnectCode
   case 0  errMsgText  = L_ErrMsg_Text
   case 1  errMsgText  = L_ErrMsg_Text
   case 2  errMsgText  = L_ErrMsg_Text
   case 260 errMsgText  = L_BadServerName_ErrorMessa ge
   case 262 errMsgText  = L_LowMemory_ErrorMessage
   case 264 errMsgText  = L_ConnectionTimeout_ErrorM essage
   case 516 errMsgText  = L_NotResponding_ErrorMessa ge
   case 518 errMsgText  = L_LowMemory_ErrorMessage
   case 520 errMsgText  = L_BadServerName_ErrorMessa ge
   case 772 errMsgText  = L_NetworkErr_ErrorMessage
   case 774 errMsgText  = L_LowMemory_ErrorMessage
   case 776 errMsgText  = L_BadServerName_ErrorMessa ge
   case 1028 errMsgText = L_NetworkErr_ErrorMessage
   case 1030 errMsgText = L_SecurityErr_ErrorMessage
   case 1032 errMsgText = L_IllegalServerName_ErrorM essage
   case 1286 errMsgText = L_EncryptionError_ErrorMes sage
   case 1288 errMsgText = L_BadServerName_ErrorMessa ge
   case 1540 errMsgText = L_BadServerName_ErrorMessa ge
   case 1542 errMsgText = L_SecurityErr_ErrorMessage
   case 1544 errMsgText = L_LowMemory_ErrorMessage
   case 1796 errMsgText = L_NotResponding_ErrorMessa ge
   case 1798 errMsgText = L_SecurityErr_ErrorMessage
   case 1800 errMsgText = L_CannotLoopBackConnect_Er rorMessage
   case 2052 errMsgText = L_BadServerName_ErrorMessa ge
   case 2056 errMsgText = L_LicensingNegotFailed_Err orMessage
   case 2310 errMsgText = L_SecurityErr_ErrorMessage
   case 2566 errMsgText = L_SecurityErr_ErrorMessage
   case 2822 errMsgText = L_EncryptionError_ErrorMes sage
   case 3078 errMsgText = L_EncryptionError_ErrorMes sage
   case 3080 errMsgText = L_DecompressionFailed_Erro rMessage
   case 3334 errMsgText = L_ProtocolErr_ErrorMessage
   case 10500 errMsgText = L_ProtocolErr_ErrorMessage
   case else errMsgText = L_InternalErr_ErrorMessage
   end select
  end if
 Â
  msgbox errMsgText,0,L_Disconnecte dCaption_E rrorMessag e
  ReturnToConnectPage
 Â
end sub
-->
    </script>
</table>
</center>
</div>
</body>
</html>
Here is my code:
<html>
<head>
<title>Remote Desktop Web Connection</title>
<style type="text/css" media="screen">
p { color:"#000000"; font-family: "Verdana, Arial, Helvetica"; font-size:"65%"}
h1 { font-size: 100%; font-family: verdana, arial, helvetica; font-weight: bold;
     margin-top: 0em;}
p.indent { margin-left: 3em; margin-top: .5em; line-height: 1.25em; margin-bottom: .2em; margin-right: 1em;}
.button {
   FONT-FAMILY: Verdana, Helvetica, Arial, San-Serif;
   font-weight:normal;
   font-size:70%;
   color:#000000;
   background-color:#ffffff;
   border-color:#6699ff;
   margin-top:6pt;
   margin-left: .5em;
}
.topspace {margin-top: .08em; }
</style>
</head>
<body bgcolor="#ffffff">
<script language="vbscript">
<!--
const L_FullScreenWarn1_Text = "Your current security settings do not allow automatically switching to fullscreen mode."
const L_FullScreenWarn2_Text = "You can use ctrl-alt-pause to toggle your remote desktop session to fullscreen mode"
const L_FullScreenTitle_Text = "Remote Desktop Web Connection "
const L_ErrMsg_Text     = "Error connecting to remote computer: "
const L_PlatformCheck_ErrorMessa
' error messages
const L_RemoteDesktopCaption_Err
const L_DisconnectedCaption_Erro
const L_ErrConnectCallFailed_Err
const L_DisconnectRemoteByServer
const L_LowMemory_ErrorMessage = "The local computer is low on memory. Close some programs, and then connect to the remote computer again."
const L_SecurityErr_ErrorMessage
const L_BadServerName_ErrorMessa
const L_ConnectFailedProtocol_Er
const L_CannotLoopBackConnect_Er
const L_NetworkErr_ErrorMessage = "The connection was ended because of a network error. Please try connecting to the remote computer again."
const L_InternalErr_ErrorMessage
const L_NotResponding_ErrorMessa
const L_VersionMismatch_ErrorMes
const L_EncryptionError_ErrorMes
const L_ProtocolErr_ErrorMessage
const L_IllegalServerName_ErrorM
const L_ConnectionTimeout_ErrorM
const L_DisconnectIdleTimeout_Er
const L_DisconnectLogonTimeout_E
const L_ProtocolErrWITHCODE_Erro
const L_LicensingTimeout_ErrorMe
const L_LicensingNegotFailed_Err
const L_DisconnectRemoteByServer
const L_LogoffRemoteByServer_Err
const L_DisconnectByOtherConnect
const L_ConnectionBroken_ErrorMe
const L_ServerOutOfMemory_ErrorM
const L_LicenseInternal_ErrorMes
const L_NoLicenseServer_ErrorMes
const L_NoLicense_ErrorMessage = "The remote session was disconnected because there are no Terminal Server client access licenses available for this computer.Please contact the server administrator."
const L_LicenseBadClientMsg_Erro
const L_LicenseHwidDoesntMatch_E
const L_BadClientLicense_ErrorMe
const L_LicenseCantFinishProtoco
const L_LicenseClientEndedProtoc
const L_LicenseBadClientEncrypti
const L_CantUpgradeLicense_Error
const L_LicenseNoRemoteConnectio
const L_DecompressionFailed_Erro
const L_ServerDeniedConnection_E
const L_ControlLoadFailed_ErrorM
const L_InvalidServerName_ErrorM
sub window_onload()
  if not LCase(Navigator.CpuClass) = "x86" then
   msgbox L_PlatformCheck_ErrorMessa
  end if
  if not autoConnect() then
    Document.all.editServer.Fo
  end if
end sub
function autoConnect()
   Dim sServer
   Dim iFS, iAutoConnect
   sServer = getQS ("Server")
   iAutoConnect = getQS ("AutoConnect")
   iFS = getQS ("FS")
   if NOT IsNumeric ( iFS ) then
     iFS = 0
   else
     iFS = CInt ( iFS )
   end if
   if iAutoConnect <> 1 then
     autoConnect = false
     exit function
   else
     if iFS < 0 or iFS >= Document.all.comboResoluti
        iFS = 0
     end if
     if IsNull ( sServer ) or sServer = "" then
        sServer = window.location.hostname
     end if
     Document.all.comboResoluti
     Document.all.Server.value = sServer
     btnConnect ()
     autoConnect = true
   end if
end function
function getQS ( sKey )
   Dim iKeyPos, iDelimPos, iEndPos
   Dim sURL, sRetVal
   iKeyPos = iDelimPos = iEndPos = 0
   sURL = window.location.href
   if sKey = "" Or Len(sKey) < 1 then
     getQS = ""
     exit function
   end if
   iKeyPos = InStr ( 1, sURL, sKey )
   if iKeyPos = 0 then
     sRetVal = ""
     exit function
   end if
   iDelimPos = InStr ( iKeyPos, sURL, "=" )
   iEndPos = InStr ( iDelimPos, sURL, "&" )
   if iEndPos = 0 then
     sRetVal = Mid ( sURL, iDelimPos + 1 )
   else
     sRetVal = Mid ( sURL, iDelimPos + 1, iEndPos - iDelimPos - 1 )
   end if
   getQS = sRetVal
end function
sub checkClick
   if Document.all.Check1.Checke
     Document.all.tableLogonInf
     Document.all.editUserName.
     Document.all.editDomain.Di
   else
     Document.all.tableLogonInf
     Document.all.editUserName.
     Document.all.editDomain.Di
   end if
end sub
sub OnControlLoadError
  msgbox L_ControlLoadFailed_ErrorM
end sub
sub OnControlLoad
  set Control = Document.getElementById("M
  if Not Control is Nothing then
   if Control.readyState = 4 then
     Document.all.connectButton
   end if
  end if
end sub
sub BtnConnect
  Dim serverName
  'server
  if not Document.all.Server.value = "" then
   serverName = Document.all.Server.value
  else
   serverName = Document.location.hostname
  end if
 Â
  serverName = trim(serverName)
 Â
  On Error Resume Next
  MsRdpClient.server = serverName
  If Err then
   msgbox L_InvalidServerName_ErrorM
   Err.Clear
   exit sub
  end if
  On Error Goto 0
 Â
  'serverName name text
  Document.all.srvNameField.
 Â
  'Username/Domain
  if Document.all.CheckBoxAutoL
   MsRdpClient.UserName = Document.all.UserName.Valu
   MsRdpClient.Domain = Document.all.Domain.Value
  end if
 Â
  'Resolution
  MsRdpClient.FullScreen = FALSE
  select case document.all.comboResoluti
  case "1"
   MsRdpClient.FullScreen = TRUE
   resWidth  = screen.width
   resHeight = screen.height
  case "2"
   resWidth  = "640"
   resHeight = "480"
  case "3"
   resWidth  = "800"
   resHeight = "600"
  case "4"
   resWidth  = "1024"
   resHeight = "768"
  case "5"
   resWidth  = "1280"
   resHeight = "1024"
  case "6"
   resWidth  = "1600"
   resHeight = "1200"
  end select
  MsRdpClient.DesktopWidth = resWidth
  MsRdpClient.DesktopHeight = resHeight
 Â
 Â
  MsRdpClient.Width = resWidth
  MsRdpClient.Height = resHeight
 Â
  'Device redirection options
  MsRdpClient.AdvancedSettin
  MsRdpClient.AdvancedSettin
  MsRdpClient.AdvancedSettin
  MsRdpClient.AdvancedSettin
 Â
  'FullScreen title
  MsRdpClient.FullScreenTitl
 Â
  'Display connect region
  Document.all.loginArea.sty
  Document.all.connectArea.s
 Â
  'Connect
  MsRdpClient.Connect
end sub
-->
</script>
<!-- Â
-->
<!-- =========================L
-->
<div id=loginArea>
<font size="4">
<img border="0" src="win2000l.gif" id=leftalign align="left" width="124" height="123" hspace="10"></font></font>
</font><font size="6" id=Tahoma2 face="Tahoma">
<img border="0" src="win2000r.gif" hspace="0" vspace="7" width="145" height="45"></font><font id=Tahoma3 face="Tahoma" size="4"><br>
</font><b>
<font id=Tahoma4 face="Tahoma" size="4"><ID id=bigtitle>Remote Desktop Web Connection </ID></font></b><p> <
<table border="0" width="640" cellspacing="0" cellpadding=0 style="margin-top: -1em;">
<!-- Graphic bar row  -->
<tr>
<td width="50%"></td>
<td colspan=3 align="left" valign="middle">
<img src="bluebarh.gif" alt="blue bar graphic" width="325" height="8"></td>
</tr>
<!-- Row 1 -->
  <tr>
<!-- Column 1 spans 4 rows -->
  <td valign="top" width="50% "rowspan=4>
     <p class=indent>
        <ID id=remotecomputername>Clic
     <p class=indent><ID id=helpfultip1>When the connection page opens, you can add it to your Favorites for easy connection to the same computer.</ID></p>
  </td>
<!-- Column 2 spans 4 rows-->
   <td rowspan=4 valign="top" align="left">
  <img src="bluebarv.gif" alt="blue bar graphic" border=0 width="8" height="330">
   </td>
  Â
<!-- Column 3 --> Â Â Â Â Â
  <td id="ServerNameKeyWidth" style="width:10%;" valign="middle">  Â
     <label id=ServerNameKey accessKey="S" for="editServer">
     <br><p align="right"> <ID id=ServerName><u>S</u>erve
     </td>
     Â
<!-- Column 4 --> Â Â Â Â Â Â
   <td id="ServerKeyWidth" width="40%" valign="bottom">
   <br> <input type="text" name="Server" size="41" id="editServer" value="123.123.123.123">
  Â
   </td>
   </tr>
<!-- Row 2 -->
<tr>
<!-- Column 3 -->
<td valign="middle">
<p align="right"><label id=sizeKey accessKey="Z" for="comboRes" class="sizespace"><ID id=size>Si<u>z</u>e:</ID><
<!-- Column 4 -->
<td valign="bottom"> &nbs
       <option selected value="1"><ID id=option1>Full-screen</ID
       <option value="2"><ID id=option2>640 by 480</ID></option>
       <option value="3"><ID id=option3>800 by 600</ID></option>
       <option value="4"><ID id=option4>1024 by 768</ID></option>
       <option value="5"><ID id=option5>1280 by 1024</ID></option>
       <option value="6"><ID id=option6>1600 by 1200</ID></option>
      </select> </label>
</td>
</tr>
<!-- Row 3 -->
<tr>
<!-- Column 3 -->
<td></td>
<!-- Column 4 -->
<td align="bottom"> Â Â Â Â Â Â Â
   <p class=topspace> <inpu
   Â
<span ID="tableLogonInfo" style="display: none">
      <p align="right" class=topspace>
        <br>
        <ID id=usernamelabel><u>U</u>s
        <label id=UserNameKey accessKey="U" for="editUserName"><input type="text" name="UserName" id=editUserName size="25"></label><br>
        <ID id=domainlabel><u>D</u>oma
     <label id=editDomainKey accessKey="D" for="editDomain">
     <input type="text" name="Domain" id=editDomain size="25"></label></p></sp
     <input type="submit" id=connectbutton value="Connect" disabled="TRUE" name="ButtonLogin" OnClick=BtnConnect class="button">
</td>
</tr>
<!-- Row 4 -->
<tr>
<!-- Column 3 -->
<td  height="215"> </td>
<!-- Column 4 -->
<td> </td>
</tr>
Â
  Â
</table>
</div>
<!-- ==========================
-->
<!-- ==========================
-->
<div id=connectArea style="display: none">
<center>
    <table>
    <tr>
    <OBJECT language="vbscript" ID="MsRdpClient"
    onerror="OnControlLoadErro
    onreadystatechange="OnCont
    CLASSID="CLSID:7584c670-22
    CODEBASE="msrdp.cab#versio
    WIDTH=<% resWidth = Request.QueryString("rW")
      if  resWidth < 200 or resWidth > 1600 then
        resWidth = 800
      end if
      Response.Write resWidth %>
    HEIGHT=<% resHeight = Request.QueryString("rH")
      if  resHeight < 200 or resHeight > 1200 then
        resHeight = 600
      end if
      Response.Write resHeight %>>
    </OBJECT>
    </tr>
    <tr>
    <br>
    <font size="1" color="#000000" id="srvfontname" face="Verdana, Arial, Helvetica">
    <div id=connectDisplay style="display:none">
    <ID id=loggedinsrv>Connected to </ID><i><span id="srvNameField"></span><
    </tr>
   Â
<script language="VBScript">
<!--
sub ReturnToConnectPage()
  Window.Navigate("Default.h
end sub
sub MsRdpClient_OnConnected()
  Document.All.connectDispla
end sub
sub MsRdpClient_OnDisconnected
  extendedDiscReason = MsRdpClient.ExtendedDiscon
  majorDiscReason = disconnectCode And &hFF
  if (disconnectCode = &hB08 or majorDiscReason = 2 or majorDiscReason = 1) and not (extendedDiscReason = 5) then
   'Switch back to login area
   ReturnToConnectPage
   exit sub
  end if
 Â
  errMsgText = L_DisconnectRemoteByServer
  if not extendedDiscReason = 0 then
   'Use the extended disconnect code
   select case extendedDiscReason
   case 0  errMsgText  = ""
   case 1  errMsgText  = L_DisconnectRemoteByServer
   case 2  errMsgText  = L_LogoffRemoteByServer_Err
   case 3  errMsgText  = L_DisconnectIdleTimeout_Er
   case 4  errMsgText  = L_DisconnectLogonTimeout_E
   case 5  errMsgText  = L_DisconnectByOtherConnect
   case 6  errMsgText  = L_ServerOutOfMemory_ErrorM
   case 7  errMsgText  = L_ServerDeniedConnection_E
   case 256 errMsgText  = L_LicenseInternal_ErrorMes
   case 257 errMsgText  = L_NoLicenseServer_ErrorMes
   case 258 errMsgText  = L_NoLicense_ErrorMessage
   case 259 errMsgText  = L_LicenseBadClientMsg_Erro
   case 260 errMsgText  = L_LicenseHwidDoesntMatch_E
   case 261 errMsgText  = L_BadClientLicense_ErrorMe
   case 262 errMsgText  = L_LicenseCantFinishProtoco
   case 263 errMsgText  = L_LicenseClientEndedProtoc
   case 264 errMsgText  = L_LicenseBadClientEncrypti
   case 265 errMsgText  = L_CantUpgradeLicense_Error
   case 266 errMsgText  = L_LicenseNoRemoteConnectio
   case else errMsgText = L_ErrMsg_Text
   end select
   if extendedDiscReason > 4096 then
     errMsgText = L_ProtocolErrWITHCODE_Erro
   end if
  else
   ' no extended error information, use the disconnect code
   select case disconnectCode
   case 0  errMsgText  = L_ErrMsg_Text
   case 1  errMsgText  = L_ErrMsg_Text
   case 2  errMsgText  = L_ErrMsg_Text
   case 260 errMsgText  = L_BadServerName_ErrorMessa
   case 262 errMsgText  = L_LowMemory_ErrorMessage
   case 264 errMsgText  = L_ConnectionTimeout_ErrorM
   case 516 errMsgText  = L_NotResponding_ErrorMessa
   case 518 errMsgText  = L_LowMemory_ErrorMessage
   case 520 errMsgText  = L_BadServerName_ErrorMessa
   case 772 errMsgText  = L_NetworkErr_ErrorMessage
   case 774 errMsgText  = L_LowMemory_ErrorMessage
   case 776 errMsgText  = L_BadServerName_ErrorMessa
   case 1028 errMsgText = L_NetworkErr_ErrorMessage
   case 1030 errMsgText = L_SecurityErr_ErrorMessage
   case 1032 errMsgText = L_IllegalServerName_ErrorM
   case 1286 errMsgText = L_EncryptionError_ErrorMes
   case 1288 errMsgText = L_BadServerName_ErrorMessa
   case 1540 errMsgText = L_BadServerName_ErrorMessa
   case 1542 errMsgText = L_SecurityErr_ErrorMessage
   case 1544 errMsgText = L_LowMemory_ErrorMessage
   case 1796 errMsgText = L_NotResponding_ErrorMessa
   case 1798 errMsgText = L_SecurityErr_ErrorMessage
   case 1800 errMsgText = L_CannotLoopBackConnect_Er
   case 2052 errMsgText = L_BadServerName_ErrorMessa
   case 2056 errMsgText = L_LicensingNegotFailed_Err
   case 2310 errMsgText = L_SecurityErr_ErrorMessage
   case 2566 errMsgText = L_SecurityErr_ErrorMessage
   case 2822 errMsgText = L_EncryptionError_ErrorMes
   case 3078 errMsgText = L_EncryptionError_ErrorMes
   case 3080 errMsgText = L_DecompressionFailed_Erro
   case 3334 errMsgText = L_ProtocolErr_ErrorMessage
   case 10500 errMsgText = L_ProtocolErr_ErrorMessage
   case else errMsgText = L_InternalErr_ErrorMessage
   end select
  end if
 Â
  msgbox errMsgText,0,L_Disconnecte
  ReturnToConnectPage
 Â
end sub
-->
    </script>
</table>
</center>
</div>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Ok, I did not think of that...they can look it up in the source anyway, so it does not really matter. I added a record in the DNS which works internally, but not externally, and its just too much work to ask my ISP to add the record.... :)
What about registering a domain name, and pointing it to your server's address... That would resolve to the right ip from everywhere.
123.123.123.123 Â Â Server