Advertisement
Guest User

Untitled

a guest
Feb 20th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.67 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <title>Blah blah</title>
  4.         <style>
  5.             *
  6.             {
  7.                 font-size: 9pt;
  8.             }
  9.  
  10.             .resultdisplay
  11.             {
  12.                 font-family: "Lucida Console";
  13.                 color: white; background: black;
  14.             }
  15.         </style>
  16.         <script type="text/javascript">
  17.             function createCOMObject( progId )
  18.             {
  19.                 return new ActiveXObject( progId );
  20.             }
  21.            
  22.             function sleep( milliSecs )
  23.             {
  24.                 // TODO:
  25.             }
  26.  
  27.             var wshShell    = createCOMObject( "WScript.Shell" )
  28.  
  29.             function updateResult()
  30.             {
  31.                 //alert( wshShell.CurrentDirectory );
  32.                 var process = wshShell.Exec( "uh.console_app.exe" );    // TODO: name.
  33.                 var input   = username.value;
  34.                 process.StdIn.Write( input + "\r\n" );
  35.  
  36.                 var output = "";
  37.                 while( !process.StdOut.AtEndOfStream )
  38.                 {
  39.                     output += process.StdOut.Read( 1 );
  40.                     sleep(100);
  41.                 }
  42.                 resultDisplay.innerText = output;   // TODO: Remove prompt text, etc.
  43.             }
  44.         </script>
  45.  
  46.     </head>
  47.    
  48.     <body>
  49.         <div>
  50.             <label for="username">Your name?</label>
  51.             <input id="username" type="text" width="40em"/>
  52.             <button onclick="updateResult()">Update results</button>
  53.         </div>
  54.         <hr/>
  55.         <div id="resultDisplay" class="resultdisplay" style="">
  56.             Blah blah
  57.         </div>
  58.     </body>
  59. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement