Retrieve the User-Agent HTTP

ObtainUserAgentString retrieves the User-Agent HTTP request header string that is currently being used.

//..
#pragma comment (lib, "urlmon.lib")
//..
char httpUseragent[512];
DWORD szhttpUserAgent = sizeof(httpUseragent);
ObtainUserAgentString( 0, httpUseragent, &szhttpUserAgent );
printf("%sn", httpUseragent);
//..
Categories: C++ Tags: , , , , , ,
%d bloggers like this: