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); Ser is a long to be converted to a string that can be used while (Ser)//convert a long to char*{tmp[flag++]= (char) (ser%10+ ' 0 '); ser/=10;} tmp[flag]= ' + '; 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", x), if (times> ( -1*usetimes+50)) return Times;else return 0;}
Server-side (PHP):