Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB code to see if netstat foreign address is open

Posted on 2013-05-29
5
Medium Priority
?
685 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

618 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