jayy66 Posted October 5, 2006 Posted October 5, 2006 Hello everyone, Im trying to view ports on a fax server to determine if they are in free or being used. I tried using FaxCom.dll and faxcomex.dll with no luck. Here is my code usind faxcom.dll: Dim faxSvr As New FAXCOMLib.FaxServer Dim fs As FAXCOMLib.FaxStatus Dim fp As FAXCOMLib.FaxPorts Dim IsRecieving As Integer Dim IsSending As Integer Dim counter As Integer Dim freePort As Integer = 0 faxSvr.Connect(Server) fp = faxSvr.GetPorts For counter = 1 To fp.Count fs = fp.Item(counter) IsRecieving = fs.Receive IsSending = fs.Send If IsRecieving > 0 And IsSending > 0 Then 'freeport remains unchanged Else freePort = freePort + 1 End If Next faxSvr.Disconnect() Return freePort the error occurs at fp = faxSvr.GetPorts but there is no confirmation that I am successfully connecting to the server in the line before. Does anybody know why this error is occuring?? Or better yet, does anybody know of a alternative way of doing this?? Thankx Quote
Gill Bates Posted October 5, 2006 Posted October 5, 2006 Are these TCP ports? If so, then you really do not even need to use their DLL. You can just try connecting the the IP for a range of ports. If the connection is successful you obviously know that port is being used and you can instantly disconnect. Most TCP port scanners do this sort of brute force scan. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.