advertisements
اليوم بإذن الله سنقوم ببرمجة
برنامج صغير يدعم
تنفيذ أوامر وفتح متصفح على رابط معين
كود التمرين :
#include "stdio.h" /* Hackshow Network C Course */ /* Function Declaration */ void menu(); void launch(); main() { menu(); } /* function Definition */ void launch() { char addr[100]={{'\0'}}; char site[100]={{'\0'}}; strcat(addr,"start http://"); printf("\nEnter The site to visit ex:google.com : "); scanf("%s",&site); strcat(addr,site); system(addr); menu(); } void cmd() { char t[10]={{'\0'}}; printf("\nEnter CMD : "); scanf("%s",&t); system(t); menu(); } void menu() { int choice=0; printf("\n ::: Menu ::: \n"); printf("\n1.Execute\n\n2.launch Browser\n\n3.exit\n "); printf("\nYour choice :"); scanf("%i",&choice); switch (choice) { case 1 :cmd(); break; case 2 : launch();break; case 3 : exit(0);break; default: menu();break; } }
فديو الشرح :
قي أمان الله
0 commentaires :
Publier un commentaire