|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
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: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: |
HINTERNET hSession = InternetOpen("Unknown",INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
HINTERNET hConnection = InternetConnect(hSession,
"localhost", //argv[1], // Server
INTERNET_DEFAULT_HTTP_PORT,
NULL, // Username
NULL, // Password
INTERNET_SERVICE_HTTP,
0, // Synchronous
NULL); // No Context
HINTERNET hRequest = HttpOpenRequest(hConnection,
"GET",
"uploader.php",
NULL, // Default HTTP Version
NULL, // No Referer
(const char**)"*/*\0", // Accept anything
0, // Flags
NULL); // No Context
HttpSendRequest(hRequest,
NULL, // No extra headers
0, // Header length
NULL, // No Body
0); // Body length
DWORD dwContentLen;
DWORD dwBufLen = sizeof(dwContentLen);
if(HttpQueryInfo(hRequest,
HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER,
(LPVOID)&dwContentLen, //Address of the buffer that receives the information
&dwBufLen, //Address of a value that contains the length of the data buffer
0))
{
// You have a content length so you can calculate percent complete
char *pData = (char*)GlobalAlloc(GMEM_FIXED, dwContentLen + 1);
DWORD dwReadSize = dwContentLen;
DWORD dwBytesRead;
InternetReadFile(hRequest, pData, dwReadSize, &dwBytesRead);
// Null terminate data
pData[dwContentLen] = 0;
// Display
cout << endl << "Download Complete" << endl;
cout << pData;
}
else
{
DWORD err = GetLastError();
// No content length...
// Just read until we are done.
char pData[100];
DWORD dwBytesRead = 1;
while (dwBytesRead)
{
InternetReadFile(hRequest, pData, 99, &dwBytesRead);
pData[dwBytesRead] = 0;
cout << pData;
}
}
|
Advertisement
| Hall of Fame |