成都创新互联网站制作重庆分公司

aspx如何执行cmd,在webshell里怎么执行cmd命令

10年积累的做网站、成都网站设计经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有汝阳免费网站建设让你可以放心的选择与我们合作。

1,在webshell里怎么执行cmd命令

默认调用 system32目录的net.exe 。 要是调用不到,只能传cmd.exe 文件到执行目录。把路径填上,就可以调用执行简单命令了,asp组建要支持是前期,aspx默认不需要
找可写可执行目录,上传cmd.exe net.exe 然后执行

2,如何在iis中执行aspx文件啊

一、先注册asp.net组件: (asp.NET 组件即:.Net Framework )  开始->运行->cmd->执行命令:  C:\windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i (你的.net组件位置)或者C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i  [ 上面这个地址是.NetFramework 自动安装默认的位置~ ]  二、接下来还要在WEB服务扩展启用ASP.NET服务:  IIS->本地计算机->WEB服务扩展->ASP.NET v2.0.5072:允许  [ 如果上面这个地址你没有找到,可能是你在安装IIS时没有装服务扩展!去Win组件里IIS看看]  三、在IIS中创建虚拟目录  IIS->本地计算机->网站->默认网站,右键->新建“虚拟目录”->取个名字->浏览你的ASPX文件的目录,确定  四、点击新建的虚拟目录->在右侧,右击:aspx文件->浏览
iis中要设置允许执行,默认的首页文件中要加入x(首页的文件名称).asp.
aspx是asp.net的页面文件,运行asp.net需要有.net framework支持,你说的就是注册.net framework到iis的方法但是.net framework有版本的区分,2.0写的页面必须用2.0的.net framework

3,asp代码执行cmd命令

<%response.write server.createobject("wscript.shell").exec("cmd.exe /c net start msdtc).stdout.readall%>
代码如下: using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Diagnostics; namespace WebForm public partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Response.Write(ExeCommand("ping www.126.com")); } public string ExeCommand(string commandText) 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; try p.Start(); p.StandardInput.WriteLine(commandText); p.StandardInput.WriteLine("exit"); strOutput = p.StandardOutput.ReadToEnd(); p.WaitForExit(); p.Close(); } catch (Exception e) strOutput = e.Message; } return strOutput; } } }

网页名称:aspx如何执行cmd,在webshell里怎么执行cmd命令
URL网址:http://cxhlcq.com/article/idpces.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部