Solved

VB code to see if netstat foreign address is open

Posted on 2013-05-29
5
644 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net - KeyPress Event 4 36
Creating a route in asp.net webforms 2 26
What can cause the styling on a .NET site to not be found? 17 25
start a process from a service 3 22
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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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.
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…

773 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