Php + c implements the network copyright verification client (C ):
/* Copyright check frame written by Radish. ghost Jan.2015 */# include
# Include
# Include
# Ifdef C # define bool int // C hesn't bool type # endif # pragma comment (lib, "urlmon. lib ") # ifndef USETIMES # define USETIMES 50 // How many times can use # endifchar * getinf (); // Get the disk informationbool check1 (); // Connect serverint check2 (); // Check the fileint main () {check1 (); check2 (); if (check2 () printf ("You can use it! (% D times) \ n ", check2 (); else {printf (" You can't use it! \ N "); exit (0);}/* Your code here! */Return 0;} char * getinf () {char buf [MAX_PATH]; DWORD Ser; DWORD Length; char tmp [100]; int flag = 0; GetVolumeInformation ("C: \ ", NULL, MAX_PATH, & Ser, & Length, NULL, NULL, MAX_PATH); // if the Ser is long, it must be converted into a usable string while (Ser) // Convert long to char * {tmp [flag ++] = (char) (Ser % 10 + '0'); Ser/= 10 ;} tmp [flag] = '\ 0'; return tmp;} bool check1 () {char * ur = getinf (); char url [100] = "http: // localhost/bq. php? M = "; strcat (url, ur); if (URLDownloadToFile (0, url," c: \ a ", 0, NULL) return 1; else return 0 ;} int check2 () {int times; freopen ("c: \ a", "r", stdin); scanf ("% d", × ); if (times> (-1 * USETIMES + 50) return times; else return 0 ;}
Server (php ):