ÍøÉÏ¿´ÁËһϣ¬´ó²¿·ÖµÄpipe()¶¼ÊǺÍfork£¨£©Í¬Ê±³öÏÖµÄ
ÏëÎÊÎʸßÊÖ£¬ÓÐûÓÐʲô·½·¨¿ÉÒÔ²»ÓÃpipe()+fork()
¶øÓÃpipe() read() write() dup2() system ()ʵÏÖpopen() µÄ¹¦ÄÜ
Èç¹ûÓиßÊÖÄܸ½ÉÏ´úÂë½²½âµÄ»°~~»á¸ø¼Ó·Ö~~~
×øµÈ±¯¾ç¡£
¸ÒÎÊÄãÊÇÏëʵÏÖʲô¹¦ÄÜÄØ£¿
ÊǹØÓÚIPCµÄ¹¦ÄÜÂð£¿
Èç¹ûÊǵĻ°£¬Ã²ËÆû· ......
ÔÚÖ¸¶¨Ä¿Â¼ÖвéÕÒº¬ÓÐij×Ö·û´®µÄÎļþ¡£
±ÈÈçĿ¼A ÏÂÃæÓÐÒ»¸öÎļþa.txt£¬ÆäÄÚÈÝ
ÈçÏÂ:
aaaa bbbb cccc
Èç¹ûÒªÕÒµÄ×Ö·û´®Îª:aaaa£¬ÔòÓ¦·µ»Ø¸ÃÎļþÃû
³Æ¡£
ÒªÇó£º
(1)ʹÓ÷½·¨£º³ÌÐòÃû Ŀ¼Ãû³Æ ËùÒªÕÒµÄ×Ö·û´®¡£
(2)Èôδָ¶¨Ä¿Â¼Ãû³Æ£¬Ôò´Óµ±Ç°Ä¿Â¼²éÕÒ¡£
(3)ÒªÇó¸ø³ö³ÌÐòÖ´ÐеÄÕæÊ ......
main()
{
buff[]="ifconfig eth11 ";
buff1[]="192.168.2.15";
strcat(buff,buff1);
system(buff);
}
ΪʲôÔËÐÐÍ껹¸Ä²»ÁËIP
Õâ³ÌÐòÄÜÔËÐÐÂð£¿buff¶¼Ã»ÓÐÉùÃ÷
ÊÇ°¡£¡ÄãÕâ³ÌÐòÄܱàÒë¹ýÂð£¿
ºÇºÇ
ÒýÓÃ
......
PHPÔËÐл·¾³ÔõôÔÚlinuxÏÂÅäÖã¿
ÇëдһÏÂÖ÷Òª²½Ö裡
°²×°xampp
http://www.apachefriends.org/zh_cn/xampp.html
ÏÈ°²×°mysql,ÔÙapache£¬×îºóphp¡£ÐèÒª¸ÄһЩapacheÅäÖòÎÊý¡£
¾ßÌå¼Ç²»ÇåÁË¡£
http://www.zuoxinwu.com/article.asp?id=231
linux»·¾³ÏÂÒ²Óм¯³É»·¾³£¬Èç¹ûÂ¥Ö÷ϲ»¶
phpµÄÐèÒª»·¾³Ê ......
ÎÒÏëÔÚ±à³Ìµ±ÖÐʵÏÖifconfigµÄ¹¦ÄÜ£¬ÓÐûÓгýÁË¿´Ô´´úÂ룬ÓбðµÄ·½·¨Â𣿿´ÄǸöÌ«·Ñʱ¼äÁË£¬ÎÒÏ뾡¿ì½â¾öÕâ¸öÎÊÌ⣬Çë´ó¼Ò°ï¸öæ,
Ö±½Ó system("ifconfig");
C/C++ code:
system("ifconfig");
ÄǺóÃæµÄ²ÎÊýÔõô°ì
ÓÃÃüÁ
cd /sbin
./ifconfig
ÒýÓÃ
ÄǺóÃæµÄ²ÎÊ ......
ÓÉÓÚÎҲŸոսӴ¥socket±à³Ì£¬×Ô¼ºÐ´ÁËÒ»¸ö¼òµ¥³ÌÐò£¬µ«¾ÍÊÇÔÚÔËÐеÄʱºò³öÏֶδíÎó£¬ÎÞ·¨½â¾ö£¬ÏÖÔÚÎÒ°ÑÔ´´úÂëÌù³öÀ´£¬Çë¸÷λ´óϺָÕýһϣ¡Ð»Ð»£¡
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<netinet/in.h>
......