October 31st, 2002, 08:52 AM
how to use Dos commands in Borlad C
I want to make a small program in C language to whom when i run should Ping specific range of IP addresses on my LAN system.For example my range is from 192.168.0.41 to 192.168.0.59 so every time if i want to check the number of users online i need to pickup and dial at lab or secondly if phone is busy i use to Ping each IP address and it is very hectic.So i want to make a program to whom when i run should ping whole series of 18 IP and it will tell that number of users alive and dead.Secondly it will be more better if it also give me alive IP addresses.So please help me.Donot tell me to use IP Scanner i know many of them but i want to design my own small and simple.i donot need fency software i just need information about users. Please tell me how we can use Dos commands of Ping ,netstat,ipconfig in Borland C.
October 31st, 2002, 09:02 AM
I'm not 100% sure this works with Borland C, but it works fine if you run it on a linux/unix system.
The way I figure it you're in the need of calling some system calls to "shell" commands. Then you just run the function system(<commandname>); and the program will execute that command.
Can't remember which library you need to include, but its one of the standard ones.
October 31st, 2002, 10:44 AM
If you're using C++ Builder (based on the Borland compiler), there is a convenient ICMP component included in the Professional version (possibly also in Basic). This will be better than shelling to a DOS command, because you'll have better access to the actual ping data.
Articles and commentary on web development