PC Review


Reply
Thread Tools Rate Thread

How to check a network server is available

 
 
=?Utf-8?B?TGkgUGFuZw==?=
Guest
Posts: n/a
 
      20th Feb 2004
Hi

Anybody knows how to check a network server is available (pingable)

Many thanks in advance.
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      20th Feb 2004
* "=?Utf-8?B?TGkgUGFuZw==?=" <(E-Mail Removed)> scripsit:
> Anybody knows how to check a network server is available (pingable)?


Sample in C#:

<http://www.c-sharpcorner.com/network/ping.asp>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      20th Feb 2004
Hi Li Pang,

Will you try this and message us if it works, I am in doubt, because I
thought that Ken did distribute this, but he did not send it to you.

Dim hostInfo As System.Net.IPHostEntry
hostInfo = System.Net.Dns.GetHostByAddress("xxx.xxx.xxx.xxx") ' a fixed
server IP
MessageBox.Show(hostInfo.HostName)

Cor


 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      20th Feb 2004
Hi Li Pang,

If you than test the name of the server it should go is my thought than or
does it give the name anyway from the registry or someting?.

Cor
>
> Your codes work for getting host name, but can't manage if the server is

not pingable.
>
> Dim hostInfo As System.Net.WebRequest
> Try
> hostInfo = System.Net.Dns.GetHostByAddress("xxx.xxx.xxx.xxx")
> Catch exc As Exception
> MessageBox.Show(exc.ToString)
> Exit Sub
> End Try
>
> no error catch if the server is disconnected from the network.
>
> Li Pang



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      20th Feb 2004
Hi Li,

Than this methode is unusable.

Thanks.

Cor
>
> The hostname is populated either the server is available or not.



 
Reply With Quote
 
=?Utf-8?B?TGkgUGFuZw==?=
Guest
Posts: n/a
 
      20th Feb 2004
Hi Herfried K. Wagner

Is PingHost method is available in VB
The pinghost function is similar to Cor's VB codes, and I can't figure out how to manage if the server is not available


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      20th Feb 2004
* "=?Utf-8?B?TGkgUGFuZw==?=" <(E-Mail Removed)> scripsit:
> Is PingHost method is available in VB?
> The pinghost function is similar to Cor's VB codes, and I can't figure
> out how to manage if the server is not available.


You will have to translate the C# code to VB.NET, for example by using
these converters:

<http://www.remotesoft.com/>
-> "Octopus"

C# -> VB .NET Converters:

<http://www.kamalpatel.net/ConvertCSharp2VB.aspx>
<http://csharpconverter.claritycon.com/Default.aspx>
<http://www.ragingsmurf.com/vbcsharpconverter.aspx>
<http://www.aspalliance.com/aldotnet/examples/translate.aspx>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      20th Feb 2004
Hi Herfried,

Now I remember me again how I got this code, I translated it.

That was what Li said.

I have dumped it now from my HKW system.

Cor


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      20th Feb 2004
On Fri, 20 Feb 2004 02:56:04 -0800, "Li Pang" <(E-Mail Removed)> wrote:

¤ Hi,
¤
¤ Anybody knows how to check a network server is available (pingable)?
¤

See the following MS KB article:

How to ping an IP address by using sockets in Visual Basic .NET
http://support.microsoft.com/default...&Product=vbNET


Paul ~~~ (E-Mail Removed)
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
=?Utf-8?B?TGkgUGFuZw==?=
Guest
Posts: n/a
 
      25th Feb 2004
The codes in this link work for me
http://msdn.microsoft.com/library/de...ClassTopic.asp
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if server on the network up tshad Microsoft C# .NET 2 25th Aug 2006 07:56 PM
SQL Server ADO.Net error - General network error. Check your network documentation RJN Microsoft VB .NET 1 24th Apr 2006 11:11 AM
System.Data.SqlClient.SqlException - General network error. Check your network documentation Julia Microsoft ADO .NET 1 4th Aug 2004 11:00 PM
System.Data.SqlClient.SqlException: General network error. Check your network documentation. Kal Microsoft Dot NET Framework 1 24th Jun 2004 02:37 AM
System.Data.SqlClient.SqlException: General network error. Check your network documentation. Kal Microsoft ASP .NET 1 21st Jun 2004 07:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:37 AM.