DownloadFile(char *sURL, SOCKET wsh) { HRESULT hr; char seps[]= "/"; char *token; char *file; char myURL[MAX_PATH]; char myFILE[MAX_PATH]; strcpy(myURL,sURL); token=strtok(myURL,seps); while(token!=NULL) { file=token; token=strtok(NULL,seps); } GetCurrentDirectory(MAX_PATH,myFILE); strcat(myFILE, "\\"); strcat(myFILE, file); send(wsh,myFILE,strlen(myFILE),0); send(wsh,"...",3,0); hr = URLDownl oadToFile(0, sURL, myFILE, 0, 0); if(hr==S_OK) return 0; else return 1; }