Solved

VB code to see if netstat foreign address is open

Posted on 2013-05-29
5
667 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:wrmichael
ID: 39204978
mystring.indexOf("server:###") > 0

is what you are looking for.
0
 
LVL 11

Expert Comment

by:wrmichael
ID: 39204979
maybe even mystring.toUpper.indexOf(....
0
 

Author Comment

by:lrbrister
ID: 39205013
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
ID: 39205043
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
ID: 39205291
Thanks
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So, you're experiencing issues on your network and you've decided that you need to perform some tests to determine whether your cabling is good.  You're likely thinking that you may need to spend money which you probably don't have on hiring/purchas…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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