VBScript改个网页内容
vbscript吧
全部回复
仅看楼主
level 1
msycn 楼主
要求把 选择下拉框(leixing)的IP地址,自动的填入文本框(server)中
内容不全,有错误,不需要完善,只要满足上面的要求即可
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>新内容</title>
<style type="text/css" media="screen">
p { color:"#000000"; font-family: "宋体, Verdana, Arial, Helvetica"; font-size:"75%"}
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:75%;
     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 = "temp"
' error messages
sub window_onload()
    if not LCase(Navigator.CpuClass) = "x86" then
       msgbox L_PlatformCheck_ErrorMessage
    end if
    if not autoConnect() then
        Document.all.editServer.Focus
    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.comboResolution.options.length then
             iFS = 0
         end if
         if IsNull ( sServer ) or sServer = "" then
             sServer =
         end if
         Document.all.comboResolution.selectedIndex     = iFS

2010年04月15日 05点04分 1
level 1
msycn 楼主
         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 =
     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.Checked then
         
       else
      end if
end sub
sub OnControlLoadError
     msgbox
end sub
sub OnControlLoad
    set Control = Document.getElementById("MsRdpClient")
    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 =
    else
       serverName =
    end if
   
    serverName = trim(serverName)
   
    On Error Resume Next
    MsRdpClient.server = serverName
    If Err then
       msgbox L_InvalidServerName_ErrorMessage,0,L_RemoteDesktopCaption_ErrorMessage
       Err.Clear
       exit sub

2010年04月15日 05点04分 2
level 1
msycn 楼主
    end if
    On Error Goto 0
   
    'serverName name text
    Document.all.srvNameField.innerHtml = serverName
   
   
    'Resolution
    select case document.all.comboResolution.value
    case "1"
       res
       res
    end select
   
    'Device redirection options
   
    'FullScreen title
   
    'Display connect region
   
    'Connect
end sub
-->
</script>
<!--   
-->
<!-- =========================LOGIN AREA    ==========================
-->
<div id=loginArea></font><font id=Tahoma1 face="Tahoma" size="1"><br>
</font><font id=Tahoma3 face="Tahoma" size="4"><br>
</font><b>
<font id=Tahoma4 face="Tahoma" size="4">
<ID id=bigtitle></ID>
</font></b><p> </p>
<table border="0" width="640" cel
lsp
acing="0" cellpadding=0 style="margin-top: -1em;">
   <!-- Graphic bar row   -->
   <tr>
     <td width="50%"></td>
     <td colspan=3 align="left" valign="middle"><img src="" 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></ID>
     </p>
       </td>
     <!-- Column 2 spans 4 rows-->
     <td rowspan=4 valign="top" align="left"><img src="" alt="blue bar graphic" border=0 width="8" height="330"> </td>
     <!-- Column 3 -->
     <td id="ServerNameKeyWidth" style="width:45%;" valign="middle"><label id=ServerNameKey accesskey="S" for="editServer"> <br>
       </label>
         <p align="right"> 
             <ID id=ServerName> </ID>
         </p></td>
     <!-- Column 4 -->
     <td id="ServerKeyWidth" width="40%" valign="bottom">
     <select size="1" name="leixing" id="leixingip" class="topspace" >

2010年04月15日 05点04分 3
level 1
msycn 楼主
            </label>
         </p>
         </span>
       <br>
     </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>
          </tr>
<script language="VBScript">
<!--
sub ReturnToConnectPage()
    Window.Navigate("Default.htm")
end sub
sub MsRdpClient_OnConnected()
    Document.All.connectDisplay.style.display = "block"
end sub
sub MsRdpClient_OnDisconnected(disconnectCode)
    extendedDiscReason = MsRdpClient.ExtendedDisconnectReason
    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_ErrorMessage
    if not extendedDiscReason = 0 then
       'Use the extended disconnect code
       select case extendedDiscReason
       case 0    errMsgText   = ""
       case else errMsgText = L_ErrMsg_Text
       end select
       if extendedDiscReason > 4096 then
          errMsgText = L_ProtocolErrWITHCODE_ErrorMessage   & errMsgText
       end if
    else
       ' no extended error information, use the disconnect code
       select case disconnectCode
       case 0    errMsgText   = L_ErrMsg_Text
       end select
    end if
   
    msgbox errMsgText,0,L_DisconnectedCaption_ErrorMessage
    ReturnToConnectPage
   
end sub
-->
         </script>
</table>
</center>
</div>
</body>
</html>

2010年04月15日 05点04分 5
1