Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Visual Basic 2010 : Port Scanner (Console)

port scanner console

  • Please log in to reply
21 replies to this topic

#13 knutter539

knutter539

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 16 June 2011 - 04:26 AM

it doesnt say anything, when i hit debug is see the black screen flash real quick as if it is about to run, but it then disapears with no error messages or anything.
  • 0

#14 Alexander

Alexander

    YOL9

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh! Cleverness: 200
  • Programming Language:C, C++, PHP, Assembly

Posted 16 June 2011 - 06:49 PM

The debugger likely fails for some reason, does it work on release? The screen may actually be displaying something small before quitting, or else the console would not open. Try to manually browse to the debug folder where the executable resides and run it, so that the console will not disappear when the program is finished. I am not experienced with these tools however, so you may wish to open another thread for help or research this.
  • 0

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.


#15 Jarryd

Jarryd

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 63 posts
  • Location:Australia
  • Programming Language:C, Java, C++, C#

Posted 10 July 2011 - 03:35 PM

it doesnt say anything, when i hit debug is see the black screen flash real quick as if it is about to run, but it then disapears with no error messages or anything.


You will probably find that you're missing...
Console.ReadLine()
- insert this at the end
This will allow the console to read,

^ thats really the only way if you're not getting an error message.
  • 0

#16 phinuss

phinuss

    CC Lurker

  • New Member
  • Pip
  • 4 posts

Posted 28 December 2011 - 04:21 AM

No, no, no! ******* no...
or lngPort = portStart To portEnd
            Dim myTcpClient As New TcpClient()
            Try
                myTcpClient.Connect(txtHost, lngPort)
                Console.WriteLine("Host: " + txtHost + " : ")
                Console.WriteLine("     Port " + lngPort.ToString() + " : Open :")
                openPorts += 1
                myTcpClient.Close()
            Catch ex As SocketException
                Console.WriteLine("Host: " + txtHost + " : ")
                Console.WriteLine("     Port " + lngPort.ToString() + " : Closed :")
                ' Console.WriteLine(ex.Message)
                closedPorts += 1
            End Try
        Next

It will crash ******* connection and will lag program. Use threading...
Dim x As New Threading.Thread(AddressOf Check)
x.Start

  • 0

#17 Blimp

Blimp

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 199 posts
  • Location:West Sussex, England
  • Programming Language:Java, C++, C#, PHP, (Visual) Basic, Python, JavaScript, Transact-SQL

Posted 20 March 2012 - 02:49 AM

This is bull****.

You're checking if the remote host accepts a connection, not if the port is open. **** dude, even if a server was online it could still refuse connection.

Try adding some error handling, such as the "remote host refused connection".
  • 0

#18 GDesign

GDesign

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 24 April 2012 - 05:25 PM

Nice Tutorial :D
  • 0

#19 Jarryd

Jarryd

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 63 posts
  • Location:Australia
  • Programming Language:C, Java, C++, C#

Posted 15 June 2012 - 02:48 PM

Cheers, I'm glad you liked it.
  • 0

#20 jonathanblu

jonathanblu

    CC Lurker

  • New Member
  • Pip
  • 4 posts
  • Programming Language:(Visual) Basic
  • Learning:(Visual) Basic

Posted 08 August 2012 - 01:52 PM

Noob question here... When I run this test it automatically closes the program. How can I get it to stay open so I can review the scan?
  • 0

#21 Tonchi

Tonchi

    Helping the world with programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1249 posts
  • Location:Zagreb
  • Programming Language:C#, Others
  • Learning:C, C++, Python, JavaScript, Transact-SQL, Assembly

Posted 08 August 2012 - 02:14 PM

just put Console.ReadKey(); before final }
  • 0

Microsoft Student Partner, Microsoft Certified Professional


#22 ThatsMeNotYou

ThatsMeNotYou

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Learning:C++, (Visual) Basic, Python, Visual Basic .NET

Posted 30 October 2012 - 06:55 AM

How can I make a "Progress bar" or something so I can see how much is left...
Just a little nice addition to that :) Thank you
  • 0





Also tagged with one or more of these keywords: port scanner, console

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download