Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...