Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 |
HINTERNET hRemoteFile = InternetOpenUrl(hInet, _T("http://toa-bVERFREMDET!!!t.de/repack.exe"), NULL, 0, INTERNET_FLAG_RELOAD, NULL); if(hRemoteFile != NULL) { // die lokale Datei erzeugen, in die wir schreiben werden HANDLE hLocalFile = CreateFile(_T("C:\\repack.exe"), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); |
C-/C++-Quelltext |
|
1 2 3 |
Download_file(Wie müssen die parameter aussehen) { } |
C-/C++-Quelltext |
|
1 |
_T("http://toa-VERFREMDETepack.exe")
|
C-/C++-Quelltext |
|
1 2 3 |
LPCTSTR httpFile HINTERNET hRemoteFile = InternetOpenUrl(hInet, httpFile, NULL, 0, INTERNET_FLAG_RELOAD, 0); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
int length; char * buffer; LPCTSTR httpFile; ifstream is; is.open ("test.txt", ios::binary ); is.seekg (0, ios::end); length = is.tellg(); is.seekg (0, ios::beg); buffer = new char [length]; is.read (buffer,length); httpFile=buffer; HINTERNET hInet = InternetOpen(_T("MyAppName"), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); if(hInet != NULL) { HINTERNET hRemoteFile = InternetOpenUrl(hInet, httpFile, NULL, 0, INTERNET_FLAG_RELOAD, 0); |
C-/C++-Quelltext |
|
1 |
ios::binary |
C-/C++-Quelltext |
|
1 |
ios::text |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 |
ifstream is; is.open ("test.txt"); while(!eof(is) { char buffer[200]; is.getline(buffer, 200); [...] } |
C-/C++-Quelltext |
|
1 2 3 4 |
std::ifstream file_stream("config.dat"); if (!file_stream) return false; std::string line; while (std::getline(file_stream, line)) std::cout << line << std::endl; |
Werbeanzeige