| |
giantlunarmoth
Posts: 47
Score: 0
Joined: 3/9/2005
From:
Status: offline
|
I'm trying to create the effect of real-time command output echo... <% Response.Buffer = False %> <html> <head> <title>ASP StdOut R/W Test</title> <body> <% strComputer = Request.QueryString("host") Set WshShell = Server.CreateObject("WScript.Shell") Set WshShellExec = WshShell.Exec("tracert " & strComputer) strResults = WshShellExec.StdOut.ReadAll strArray = Split(strResults, Chr(13) & Chr(10)) For Each x In strArray Response.Write (x & "<br>") Next %> </body> </html> My for loop here is superfluous as it isn't engaged until all StdOut has already been buffered. In a web context, this results in the page not loading at all until the WshShell.Exec completes (several seconds or more for a trace route)...the goal being to consecutively Response.Write each line after the page loads. I'm just curious if there's a way to read & write each line of StdOut as it "occurs"...like for each StdOut.ReadLine in WshShellExec do Response.Write(StdOut.ReadLine). :) Thanks...GLM
|
|