开发者

In ASP Classic, can I have a script close the HTTP connection and continue executing?

I have a script that occasionally needs to do some time-consuming (15s) background processing, but other times it is a simple red开发者_如何学运维irect. The redirect target is known early on in the script's execution. Is it possible to, once the redirect URL is known, send the redirect HTML to the user agent and close the HTTP response, but continue processing the script?


You could solve this by executing a program (BAT, EXE, etc) asynchronously from the ASP code.

    set wshell = CreateObject("WScript.Shell") 
    runcmd = "c:\myOwnProgram.bat param1=test"
    wshell.run runcmd, 0, False 

Wshell.Run lets you run stuff async. So fire away your timeconsuming tasks without worrying about script timeouts! Really great.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜