Hi,
I wish see what is online in my LAN(workgroup).
How I can see another computer IP in my LAN or another information
I guess I could try pinging all the IP addresses in your LAN address range, but how?
Sorry for bad english grammar :[
16 5524
Figure out what your IP addresses are for your LAN (Probably a 192.168.x.y). Then itterate through all the values of y (1-254) and see who responds?
Figure out what your IP addresses are for your LAN (Probably a 192.168.x.y). Then itterate through all the values of y (1-254) and see who responds?
Yes, I now, but how make program this with C#.
How scan lan with C#?
Start -> Run -> cmd -> Ok -> ping -t 192.168.1.101
increment the X to the next number till the ping no longer responds.
If you want to right a program in C# that does this use www.google.com and search for C# Lan View.
Start -> Run -> cmd -> Ok -> ping -t 192.168.1.101
increment the X to the next number till the ping no longer responds.
If you want to right a program in C# that does this use www.google.com and search for C# Lan View.
I very long searching in google, but nothing found.
I very long searching in google, but nothing found.
I don't think you searched at all.
.Net HAS a Ping class (System.Net.NetworkInformation.Ping) that cane be used to perform ping operations.
Thanks, but this program testing my ping(only my PC).
This program don't send ping all my lan. I say or not true?
I need program source(C# sample), who make like this program: http://www.radmin.com/products/utilities/lanscanner.php
I already told you what to do.
Iterate through your ip address range values, using PING.
If you had a domain controller, you could do it much "nicer" way.
No, this example lets you ping any address you want, not just localhost. Note that args[0] in this example contains an ip address in it. So if you define your own IPAddress instead of args[0] you can specify the address in code.
Example: (using the same code as the MSDN example but adding my own chosen IP Address. -
IPAddress address = IPAddress.Parse("192.168.20.1");
-
PingReply reply = pingSender.Send (address, timeout, buffer, options);
-
Plater has told you to iterate through all your IP addresses, and the MSDN page I sent you to shows you how to ping one address. So, knowing this, you should logically be able to modify the example to ping multiple addresses. It should even be easy enough to put in textboxes in your program to define start and stop ranges.
I have one program: -
using System;
-
using System.Net;
-
using System.Net.NetworkInformation;
-
using System.Text;
-
-
namespace Examples.System.Net.NetworkInformation.PingTest
-
{
-
public class PingExample
-
{
-
// args[0] can be an IPaddress or host name.
-
public static void Main(string[] args)
-
{
-
string server = "127.0.0.1";//address to verify, like 127.0.0.1
-
IPAddress ipa = IPAddress.Parse(server);
-
Ping p = new Ping();
-
PingReply reply;
-
reply = p.Send(server);
-
int success = 0, insuccess = 0;
-
for (int i = 0; i < 4; i++)
-
{
-
reply = p.Send(ipa);
-
if (reply.Address == ipa)
-
success++;
-
else
-
insuccess++;
-
Console.WriteLine("Pack. sent");
-
}
-
Console.WriteLine("sent = 4, recived = {0}, lost = {1}", success, insuccess);
-
Console.ReadKey();
-
}
-
}
-
}
But why always ping not work, send =4, recived = 0, lost = 4
That usually means no packets where recieved from the computer you pinged..
Like, when I ping 127.0.0.1 (which exists) I get: Sent = 4, Received = 4, Lost = 0
But when I ping 10.1.1.5 (not a pc on my network) i get: Sent = 4, Received = 0, Lost = 4
Because no computer has responded to my ping request.
So basically if you get Sent 4, recv 4 then you've got a PC there, else there is nothing at that IP.
Ben Anderson,
-
reply = p.Send(ipa);
-
if (reply.Address == ipa)
-
success++;
-
else
-
insuccess++;
-
But why always ping not work, send =4, recived = 0, lost = 4
This isn't the correct way to test if you had a successful ping. Use: -
if(reply.Status == IPStatus.Success)
-
I think that the other way, you aren't comparing the actual values, but the reference.
That usually means no packets where recieved from the computer you pinged..
Like, when I ping 127.0.0.1 (which exists) I get: Sent = 4, Received = 4, Lost = 0
But when I ping 10.1.1.5 (not a pc on my network) i get: Sent = 4, Received = 0, Lost = 4
Because no computer has responded to my ping request.
So basically if you get Sent 4, recv 4 then you've got a PC there, else there is nothing at that IP.
Ben Anderson,
There is always something at 127.0.0.1
There is some other problem there. Likely the coding error I pointed out there, or a firewall blocking the ping requests.
There is always something at 127.0.0.1
There is some other problem there. Likely the coding error I pointed out there, or a firewall blocking the ping requests.
Somewhere in XP there is an option to not respond to icmp requests. It might also not respond to requests on the loopback interface.
Yea, I think its part of the Firewall. SpyBot Search and Destory disables it too, well, if you get TeaTimer.exe anyway.
Meh, doesn't bother me, it's always worked for me. :D
Ben Anderson,
I have Spybot Teatimer on all the laptops in my apartment(friends are computer illeterate with that stuff) as well as AVG for free. Before I start data transfers from there computers(media stuff) I ping them to see so that vista doesn't crash itself. Defualt installs with slight IE modifications and the ping test still work. They are running XP as well.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jason Rodman |
last post by:
I have downloaded every example on how to create a ping utility in .Net in
both VB and C#, but have been disappointed with the results. I have YET to
find an example that returns consistent results...
|
by: Mantorok |
last post by:
Hi all
I want to ping an ipaddress/host to check for a response.
Is there any easy way in C#/.Net to do this?
Thanks
Kev
|
by: Eric Wenger |
last post by:
I'm pretty new to C# and I'm trying to do what I believe should be a
simple thing. I want to modify a program that is using the
System.Net.NetworkInformation.Ping class to have some custom...
|
by: Ed |
last post by:
I've attached some VB.NET code I've hacked together (some taken from
MS examples & newsgroup postings) that will perform a ping or
IcmpSendEcho using the icmp.dll (see this for more info:...
|
by: scotty |
last post by:
I need to do a ping scan of a subnet.
I can Enum through the IPs and do this, but it takes over 5 minutes as
I can only create 1 process at a time. Does anyone know how I can
create multiple Ping...
|
by: Neel |
last post by:
I am trying to "ping" a remote host in my C++/Redhat Linux code to
check whether that host is connected or not.
if (0 == system("ping -w 2 192.168.0.2))
But, in both cases...
|
by: Deepak |
last post by:
I am programing a ping application which pings various centers . I
used timer loop and it pings one by one.
Now when i finish pinging one center it should wait for the
ping_completed function to...
|
by: Krish |
last post by:
All,
I have an offline application that works online for some data
syncronization. For data syncronization I access a webservice. I want
to show whether my application is online or not by checking...
|
by: imughal |
last post by:
I got the perl script which does following task.
This solution reads in a line from a text file that is passed in as input parameter 1 to a Perl script. This script will then ping the machine...
|
by: Dave Marden |
last post by:
I currently use this routine in vbscript to ping computers and get the
status of ping to determine whether to try to backup a machine, I am trying
to change it to work with vb2003.net I am...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |