Ping If Network Is Available?
Jun 10, 2011
I'm currently doing my project to check my server status with ping option. but i got problem to check either the network is plugged or unplugged...I need this checking automaticly using timer...here what i have done....to ping the server is success but when pulgged back the network...error come around..
Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
Timer4.Interval = 30000
If My.Computer.Network.IsAvailable Then
If My.Computer.Network.Ping("www.mine.my", 500) Then
[code].....
View 2 Replies
ADVERTISEMENT
Nov 18, 2011
I have a .NET 2.0 *.dll that calls My.Computer.Network.Ping(). The *.dll is then run out of an *.exe via AppDomain.CreateDomain() and Invoke(). The problem is that this works just fine under Windows XP but under Windows 7, I get an exception saying that no network connection is available. I tried the Ping() call out of a small console application under Windows 7 and it works just fine.
[Code]....
View 6 Replies
Jan 3, 2010
I work as an IT Administrator and manage a few Servers, Routers, VPN Connections over a number if locations. What I am wanting to do is create a vb.net app that will go out and ping say every 2-5mins each of the servers, routers, that are listed and then shows beside the Hostname a Green Circle which means online and if its a Red Circle its offline, and the screen refreshes if their is a problem or a device / service comes back online.
Then if its offline email a particular email address showing the hostname of either the server or router and which location saying its offline. If possible to make it easier to change the devices to show possible have a txt file or something like that with the Hostname, IP Address, Location.
View 2 Replies
Jul 4, 2008
I am trying to write a program to ping computers on my network to see if they are turned on. So far i have the following:
Code:
If My.Computer.Network.Ping("192.68.0.5") Then
MsgBox("Computer is on.")
Else
MsgBox("Ping request timed out.")
End If
If i use ip addresses, this works fine but i would rather use hostnames due to the ip addresses being dynamic (something which is outside my control). Using the hostname, it reurns "Computer is on" if the ping is successful, but if the hostname cannot be found, instead on returning "Ping request timed out", an error occurs as follows:
A first chance exception of type 'System.Net.NetworkInformation.PingException' occurred in System.dll
View 2 Replies
Jul 8, 2009
i have tried altering some code i have to ping an ip address and store the result in an access db.i had it working when i had the ip hardcoded in as a string but I am now gettin an error.instead of having the ip address hardcoded in to the code i want it to be read in from the access db but im now getting this error:System.nullreferenceExceptionbject reference not set to an instance of an object at...button1.click event args ei have underlined the piece of code i tried to change
Imports System.Data
Public Class Form1
Dim Ping As Net.NetworkInformation.Ping
[CODE]...
View 39 Replies
Aug 18, 2009
Here is my idea so far: I have a bunch of computers connected in a local network. One of them is a MySQL server, one will have a vb.NET program wich will act as a "second server" and the rest will be different clients. What I want to do is that the "second server" will send out some kind of message or network package to some of the clients in the network, and they will execute a code based on what message it is, or what kind of package it is. I'll give you a simple example:
[Code]...
View 6 Replies
Oct 15, 2009
In my Windows Forms application (on startup) I use the ping command to check if both the Internet connection and my SQL Server are alive.Is there any "better" way-command I should use for accomplishing the above task in the .NET framework 2.0?
View 6 Replies
Dec 29, 2009
what are other ways to do ping in vb.net or c# other than the way found here:
Dim pinger As New System.Net.NetworkInformation.Ping
MessageBox.Show(pinger.Send("192.168.0.119").Status.ToString)
View 2 Replies
Jul 20, 2009
I have this code to ping a list of over 400 switches , the program works fine but for some reason the first time i ping all the switches alot of the attempts time-out(even tho they shouldnt) which makes the program alot slower , if i click ping again less of the attempts time-out(and as a result the program runs faster) and if i click it a third time i usually get a completely accurate result with all the switches pinging back "success" (except for a few which i know for a fact are down anyway) any ideas why this is ?
CODE:
View 5 Replies
Mar 16, 2010
I am trying to create a tool that will test to see if a device is reachable b ICMP and report back with the latency, i.e. send a ping. If possible, I would also like to get the hop count value.[code]I keep getting an error message saying " 'Send' is not a member of 'NetworkTool.Ping' ", but everyone seems to use it. So how do I do get .Send to work?
View 1 Replies
Mar 30, 2009
I cannot understand why I get no 'ping' sound when the following messagebox comes up. I'm using VISTA and VB.NET 2008.[code]
View 1 Replies
Mar 26, 2012
I am writing some code as part of a framework for opening a file.The file is of custom type and should not be opened by more than one instance of my application. To stop multiple file opening I use a filestream to create a lock file and then keep said filestream open. This seems to work in preventing another instance of my application from opening the file ( as it will fail in recreating the lock stream in the files open code ) but if the file is on a network share and the network drops then the original application also can not access the file any more.The code to get the lock stream is as follows:
Try
' We need to keep this stream alive to prevent other applications gaining access to the lock
mLockStream = New FileStream(mLockPath, FileMode.CreateNew, FileAccess.Write, FileShare.None)[code]....
In this I create the lock stream the first time round and then if another application tries to create it, it throws an exception and stops them from getting any further. This is kind of how it needs to work, unfortunately as I said, if this is done across a network and then the network connection is dropped for some reason then I can not delete the lock stream as I get an IOException telling me a process cannot access the file as it is open in another process ( which shouldn't be happening I don't think).
View 1 Replies
Sep 8, 2010
I am using VB.net to ping a domain/IP, using the following code;
My.Computer.Network.Ping(Address, 1000)
I now want to add a port to the domain/IP - e.g google.co.uk:21
How would I go about this?
View 3 Replies
May 22, 2009
I created an application using the Ping control. So far, when "Button1" is pressed, it performs a ping test to [url]... How do I create it so that it will display a message in RichTextBox1, depending on whether or not it was successful?
View 1 Replies
Feb 1, 2012
A little background, the client that I am working with has an enterprise AD that is a mess. They have no containers for servers or any organization what-so-ever. They also shutdown servers and did not remove them properly from AD. So I needed to come up with a program that would find all the windows server, identify them by OS, and then check to see if they would actually respond to a ping. (I am aware that this is not a perfect method if they are refusing ICMP's but its good enough for my purposes). The completion of the program will display all the information and then allow the user to save the excel workbook in a location that they choose.
vb.net
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
[code]......
View 4 Replies
Jun 27, 2011
I am working this little project where i need to ping some servers remotely. there's three of them. I need o ping them and per say while they're being pinged to have a command window open with the pinging process going to keep an eye untill it can ping successfully.And since this is for all three servers how do i create a program where it will have all three servers being pinged? [code]
View 6 Replies
Mar 14, 2009
I currently have the below code to ping the first record in my database.
I'd like to set it up so that if an IP in the Database pings, it moves on to the next record e.g NetMonListDataSet1.Addresses.Rows(2).Item(0).ToString. if it doesn't receive a response it "sendsmymail()".
I know i need a For Each loop somewhere maybe? But i can't seem to fit it in.
Code:
Dim myProcess As New Process()
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = True
[Code].....
View 8 Replies
Feb 15, 2012
I'm wondering if its possible to ping a website while logged into the website so you can ping a certain page which you couldn't if you was not logged in.
I seen CMD ping through VB but that doesn't have cookies or anything so the URL is inaccessible.
im currently using cookies and HttpWebRequest atm, which im looking for a faster method.
View 3 Replies
Feb 15, 2012
im wondering if its possible to ping a website while logged into the website so you can ping a certain page which you couldn't if you was not logged in
View 1 Replies
Feb 15, 2010
code for ping an ip? i want to do something like pinging in cmd, with shwoing results in a richtext box or listview...i found some codes and they don't work and i didn't make it up.
View 11 Replies
Feb 18, 2010
i have a little problem with the ping in vb. i have a richtextbox and i want to write in a text file the result. I done it, but my txt file loks like this:
[Code]...
View 21 Replies
Sep 14, 2008
Ok so for a while now ive had a program that pings about 15 computers on my network, but the way i have it is pretty messy, id like to somehow make the code a bit cleaner. so what i have is something like this
[Code]...
View 39 Replies
Nov 3, 2011
I know that you can easily send a ping request and receive a boolean return type in .NET, using something like:
[Code]...
View 2 Replies
Oct 21, 2009
im trying to do is ping a server and see if there is a response. If there is a response then i would like to set an integer to 1 if there is not a response set the integer to 0. I would also then like to gather any servers that had a response into a list box. I know how to build a list box just having trouble getting the code to set a variable if or if there isnt a response.
View 4 Replies
Apr 11, 2005
I have a module that will ping a machine given a hostname or an ip address. Is there an eaiser way to ping a machine using vb .net? I know you can use wsh to open a shell and execute the ping command from a command prompt window then use the ReadAll to get the information ping sends back and from there you can determine if the ping was sucessful or not. How would I do this in VB .Net or is there a better way to ping machines in .net?
View 17 Replies
Dec 26, 2010
Well I decided to try make a proxy checker, like Charion or Elite proxy checker. These programs accept large lists of proxies in the IP:PORT format, ping them tell you the response time see the screenshot of Elite Proxy Checker, im trying to make a simplified version of this program. [URL]I investigated and made my checker using Ping.SendAsync(ip, timeout, ip) method. It was only afterwards that I discovered that you can only Ping IP's using this method, not the ports as well. Ive spent a few hours trying to find the correct class/methods in order to be able to ping ports, reading different forum posts from experts they say its impossible to ping ports only IPS, can only use sockets to try open a connection with the port.
[Code]...
View 1 Replies
Dec 4, 2011
I changed target framework from 3.5 to 4.0, no other changes. A simple ping which worked with 3.5, now with 4.0 the result gives Canceled=True. what may cause this?
Public Sub StartInternetConnectionCheckEvery(ByVal seconds As Integer)
Dim timer As New Timer()
timer.Interval = seconds * 1000
[code].....
View 1 Replies
Feb 1, 2011
What I am looking to do is ping a server every 30 minutes to an hour or so and to send an email if the server is not pingable. [code]...
I am creating the project in Visual Studio 2010. All it does now is check if it can ping a server. I would like it to run this code every 30min.
View 3 Replies
May 6, 2011
I want to ping a port to see if its online the problem is that if its offline it freezes my app for about 20sec![code]....
View 2 Replies
Jan 4, 2012
I have a listview with three columns adress: , status and interval
now, I would like to ping each adress and display its status at different intervals!
Is it possible to do that or I have to PING each row with one timer?
View 4 Replies