C > Beginners Lab Assignments
Show the active computers in the lan
Show the active computers in the lan #include
#include
#include
#include
#include
#include
//#include"h:incmenu1.c" //void netview() void main() { FILE *fs; int count=0; char ch; int gd=DETECT,gm; initgraph(&gd,&gm,""); //make(); cleardevice(); closegraph(); make(); fs=fopen("temp.txt","r"); // make(); if(fs==NULL) { clearviewport(); printf("file not found"); getch(); // if(getch()==27) // menu1(); } else while(1) { ch=fgetc(fs); if(ch==EOF) break; if(ch==' ') count++; if(count==24) { count=0; //getch(); printf(" Press Enter"); getch(); clearviewport(); setbkcolor(1); } setbkcolor(1); ch= fputc(fs,fs); printf("%c",ch); } // if(getch()==27) // menu1(); fs=fopen("temp1.txt","r"); if(fs==NULL) { printf("file not found"); getch(); // if(getch()==27) // menu1(); } else while(1) { ch=fgetc(fs); if(ch==EOF) break; printf("%c",ch); } putc(ch,fs); fclose(fs); getch(); // menu1(); } make() { system("net view > temp.txt"); system("net user > temp1.txt"); return 1; }
C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting