fork download
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication.WebForm1" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w...content-available-to-author-only...3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://w...content-available-to-author-only...3.org/1999/xhtml">
  4. <head runat="server">
  5. <script type="text/javascript">
  6. function keyPressed(e) {
  7. var code;
  8. if (window.event) {
  9. //IE
  10. code = e.keyCode;
  11. }
  12. else {
  13. //other browsers
  14. code = e.which;
  15. }
  16. //check, for example, if the Enter key was pressed (code 13)
  17. if (code == 13) {
  18. //Enter key pressed
  19. handleCommand();
  20. }
  21. else {
  22. //Another key pressed
  23. }
  24. }
  25.  
  26. function handleCommand() {
  27. var consoleInput = this.document.getElementById('consoleBody');
  28. var consoleOutput = this.document.getElementById('consoleOutput');
  29. consoleOutput.innerText = "";
  30.  
  31. switch (consoleInput.value) {
  32. case "dir":
  33. makeServerCall("dir");
  34. break;
  35. default:
  36. consoleOutput.innerText = "wrong command";
  37. break;
  38. }
  39.  
  40. consoleInput.value = "";
  41. }
  42.  
  43. function makeServerCall(command) {
  44. var xmlhttp;
  45. if (window.XMLHttpRequest) {
  46. // code for IE7+, Firefox, Chrome, Opera, Safari
  47. xmlhttp = new XMLHttpRequest();
  48. }
  49. else {
  50. // code for IE6, IE5
  51. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  52. }
  53.  
  54. xmlhttp.open("GET", "WebForm1.aspx?" + command);
  55. xmlhttp.send();
  56. }
  57. </script>
  58. <title></title>
  59. </head>
  60. <body style="background-color: Black"; onload="javascript:this.document.getElementById('consoleBody').focus();">
  61. <form id="form1" runat="server">
  62. <p>
  63. <label id="consoleHead" style="color: White; font-size: large; background-color: Black;"
  64. runat="server" />
  65. </p>
  66. <p>
  67. <textarea id="consoleBody" onkeypress="javascript:keyPressed(event);"
  68. rows="30" cols="30" style="height: 100%; width: 100%; color: White;
  69. font-size: large; background-color: Black; border-bottom-style: none;
  70. border: 0px; overflow: hidden; text-align: left;" runat="server" />
  71. </p>
  72. <p>
  73. <label id="consoleOutput" style="color: White; font-size: large; background-color: Black;"
  74. runat="server" />
  75. </p>
  76. </form>
  77. </body>
  78. </html>
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty