473,513 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Network Computers

Hello Friends,

I am making an application in which i need to list all the computers in
my network.

can anyone suggest any code to accomplish this task.

Thanks
Santosh

Oct 11 '06 #1
8 3404
Santy wrote:
Hello Friends,

I am making an application in which i need to list all the computers in
my network.

can anyone suggest any code to accomplish this task.

Thanks
Santosh
This will depend on the API provided by the underlying OS. This group
deals mainly with ISO C, which has no notion of networks. Ask in a
group which deals with programming under your OS. Generally, there're
fairly portable POSIX APIs to do this, unless you happen to code for
Billy Gates.

Oct 11 '06 #2
Santy wrote:
>
Hello Friends,

I am making an application in which i need to list all the computers in
my network.

can anyone suggest any code to accomplish this task.
This can't be done in standard C. Your networking software may have
some platform-specific calls that you can use. However, to find out
about that, you'll need to check somewhere else -- either the manual
that came with the network or C compiler, or a newsgroup that talks
about your platform.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

Oct 11 '06 #3
In article <11********************@b28g2000cwb.googlegroups.c om>,
santosh <sa*********@gmail.comwrote:
>Santy wrote:
>I am making an application in which i need to list all the computers in
my network.
>This will depend on the API provided by the underlying OS. This group
deals mainly with ISO C, which has no notion of networks. Ask in a
group which deals with programming under your OS.
Correct so far.
>Generally, there're
fairly portable POSIX APIs to do this, unless you happen to code for
Billy Gates.
Unfortunately that part is not correct. There are no POSIX APIs
to enumerate all the computers in any network -- not even if one
confines oneself to a particular subnet. No matter what API you
use on computer X, computer Y might be programmed to ignore all
packets from computer X.

--
If you lie to the compiler, it will get its revenge. -- Henry Spencer
Oct 11 '06 #4
On Wed, 11 Oct 2006 16:47:45 +0000 (UTC), in comp.lang.c ,
ro******@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote:
>In article <11********************@b28g2000cwb.googlegroups.c om>,
santosh <sa*********@gmail.comwrote:
>>Santy wrote:
>>I am making an application in which i need to list all the computers in
my network.
>>Generally, there're
fairly portable POSIX APIs to do this, unless you happen to code for
Billy Gates.

Unfortunately that part is not correct. There are no POSIX APIs
to enumerate all the computers in any network -- not even if one
confines oneself to a particular subnet. No matter what API you
use on computer X, computer Y might be programmed to ignore all
packets from computer X.
The Billy Gates part is also incorrect. Unless you're running an
antique version of Windows from the early nineties (in which case, you
ought to mention Stevie J too) it'll respond to much the same
protocols as any other networked device.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Oct 11 '06 #5
>>Unfortunately that part is not correct. There are no POSIX APIs
>>to enumerate all the computers in any network -- not even if one
confines oneself to a particular subnet. No matter what API you
use on computer X, computer Y might be programmed to ignore all
packets from computer X.

The Billy Gates part is also incorrect. Unless you're running an
antique version of Windows from the early nineties (in which case, you
ought to mention Stevie J too) it'll respond to much the same
protocols as any other networked device.
Are you claiming that no recent version of Windows has a working
firewall that can block all packets from a particular IP or netblock?
("recent" includes at least Windows XP) Even if that's true, I can
still put a Cisco router in between that computer and the outside
world to implement that block.

Oct 12 '06 #6

Santy wrote:
Hello Friends,

I am making an application in which i need to list all the computers in
my network.

can anyone suggest any code to accomplish this task.

Thanks
Santosh


for coding The application i am using the Gcc C compiler on Linux
Platform.

Oct 12 '06 #7

Santy wrote:
Hello Friends,

I am making an application in which i need to list all the computers in
my network.

can anyone suggest any code to accomplish this task.

Thanks
Santosh

sure: system( "nmap -Sp >/tmp/MyOut.Txt" )

That's a joke of sorts.

There is nothing in C itself to have anything to do with networks.

But with the system() function you can run an external program.
Luckily there's a free program called "nmap" that can do a pretty
awesome job of peeking at a network. Use google to find where to
download nmap source or binary and go to it!

Oct 12 '06 #8
Santy wrote:
Santy wrote:
>>
I am making an application in which i need to list all the
computers in my network.

can anyone suggest any code to accomplish this task.

for coding The application i am using the Gcc C compiler on Linux
Platform.
This is off-topic for c.l.c. The C language knows zip about
networks. Find a newsgroup with the word 'linux' in its name.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
Oct 12 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
6019
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network...
1
1531
by: kathy | last post by:
We need runing one program on two computers, say two computers runing a program on a network drive, we would like one is a main program, the other one as secondary. Is there any way the main one...
3
3858
by: Steve | last post by:
Hi all How would i get a list of all Active Computers on a network? All I need are the computer names. Kind Regards, Steve.
6
43842
cjbrx3115
by: cjbrx3115 | last post by:
Well, to start I just got Windows Vista a few months ago. It works great, but the trouble came when I decided to connect all of my computers - XP Home, XP Professional and Vista - to a home network....
15
7044
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
1
3221
by: zole2112 | last post by:
All of my computers were working fine with my network, 3 with XP, 1 with Vista, 1 Network HD and 1 network printer. Router is a D-Link DIR-655. I haven't changed anything but none of my XP computers...
1
7657
by: CollJ | last post by:
Hi, I just got a new computer the other day with Windows Vista. I've been trying to connect it to a network of 2 Window's XP computers without much luck. the Vista computer can access the...
1
1912
by: Alayth | last post by:
Hello, This is my current situation: I have a network of around 100 to 200 computers, and they are all left on overnight for updating purposes. The problem with this is that that many computers...
1
2436
by: 2boysnus | last post by:
I set up a network at my work last week and we have been having some problems that I have not ben able to fix. We have: 2 New computers running Windows XP 2 New Computers running Windows Vista...
24
5773
by: Asja | last post by:
I have written an application that runs in a kind of peer-to-peer framework. Servers connect to a masterserver, which a client then queries to receive a list of servers. The client selects a server...
0
7264
marktang
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,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7106
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...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3236
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.