Solved

VB code to see if netstat foreign address is open

Posted on 2013-05-29
5
631 Views
Last Modified: 2013-05-29
I need some vb code to see if a netstat foreign address exists

In otherwords, I want to see if there is a foreign address that is = servername:####
0
Comment
Question by:lrbrister
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:wrmichael
Comment Utility
mystring.indexOf("server:###") > 0

is what you are looking for.
0
 
LVL 11

Expert Comment

by:wrmichael
Comment Utility
maybe even mystring.toUpper.indexOf(....
0
 

Author Comment

by:lrbrister
Comment Utility
wrmichael,
  I have no frame of reference for what you posted.
How would I get mystring?
0
 
LVL 11

Accepted Solution

by:
wrmichael earned 500 total points
Comment Utility
Your question is very vague so I wasn't sure at what level you need help.
Are you planning to use netstat and save the results then read those results or are you wanting a program written that acts like netstat and checks the results?

you might look at examples like this:

http://www.vbforums.com/showthread.php?549612-RESOLVED-Vb-net-2008-Using-Netstat

and

http://www.codeproject.com/Articles/3672/Netstat-Example

it could become complicated.

but if you just take a netstat and save the results to a file and then parse those results for your specific string it should not be too bad.

when you say server:####   do you know what numbers you are looking for?   maybe an example of the output from netstat would also help.

Also are you really wanting to know if it exists or a list of the ones that exist?
0
 

Author Closing Comment

by:lrbrister
Comment Utility
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now