Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pulling a result using ASPExec

Status
Not open for further replies.

spperry2k5

IS-IT--Management
May 20, 2005
1
US
Hello,

I am currently in the process of trying to write a program that, once a user accesses my ASP page, the page queries a series of IP addresses and sends the user to the first available listening IP. I am using PortQry v2 from Microsoft, and it all seems to work well. PortQry should be sending a result back of 0 for listening, 1 for not listening, but when the application executes, it only returns an Ok (I've tested it out in my code to find out what my variable ends up with).

Is there a way to get ASPExec to send back the result given to me by PortQry, instead of just setting my various to "Ok"? I've put the code below -- maybe it's something I'm doing.

Thanks in advance.

Scott

dim Listener 'Listen stores the return from PortQrt (0=Listening, 1=Not Listening)
dim TailIP 'TailIP stores the last number of the IP address.

Function PortQry (TailIP)

Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "c:\portqryv2\PortQry.exe -nr -n 160.131.91." & TailIP & " -q"
Listener = Executor.ExecuteWinApp
'Response.Write ("The result of this call was:" & Listener & "<br>")

End Function

TailIP = 70

While TailIP >= 70

Listener = PortQry(TailIP)

if Listener = 0 then Response.Redirect(" & TailIP & "/HomeSafeNet")

if TailIP = 76 then TailIP=69 else tailIP = TailIP + 1

wend

'Response.Redirect ("
 
[tt]Function PortQry (TailIP)
'etc etc
[red]PortQry=Listener[/red]
End Function[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top