Hallo,
Wie kann ich eine Datei ins temp-verzeichniss downloaden?
funktioniert leider nicht! Ich muss ja der "test.dll" zuweisen in welchem ordner aber da kommt immer:
Wie mach ich das das er bsp. die Datei ins Temp verzeichniss lädt?
Und NEIN ich will kein virus schreiben.
In VB würds:
so würde er es in C:\ laden. in VB!
jedoch brauch ich das für c++!
mfg,
pking
Wie kann ich eine Datei ins temp-verzeichniss downloaden?
Code:
#include "stdafx.h"
#include <windows.h>
#include <urlmon.h>
#include <stdio.h>
#pragma comment(lib, "urlmon.lib")
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char wintemp_path[MAX_PATH];
GetTempPath(1024,wintemp_path);
URLDownloadToFile(NULL, "http://test.de/", wintemp_path / "test.dll", NULL, NULL);
return 0;
}
funktioniert leider nicht! Ich muss ja der "test.dll" zuweisen in welchem ordner aber da kommt immer:
Code:
error C2297: '/' : illegal, right operand has type 'char [9]'
Wie mach ich das das er bsp. die Datei ins Temp verzeichniss lädt?
Und NEIN ich will kein virus schreiben.
In VB würds:
Code:
URLDownloadToFile(0, http://seite.de/bla.dll, Split(Environ$("windir"), "\")(0) & "bla.dll", 0, 0)
jedoch brauch ich das für c++!
mfg,
pking