开发者

What is platform useragent of the windows platfom?

开发者 https://www.devze.com 2023-01-30 01:02 出处:网络
I am postin开发者_如何学Cg the requesting request uisng \"POST\" method, In mac platform uaser agent is

I am postin开发者_如何学Cg the requesting request uisng "POST" method, In mac platform uaser agent is 10.6.2. But the in windows waht is platform user agent.


The user agent string depends solely on the browser or whatever client you are using to make the request. It has nothing to do with the operating system, though most browsers will include some information about the OS version.

For example, on my version of Firefox it is:

Mozilla/5.0 (Windows NT 5.1; rv:2.0b7) Gecko/20100101 Firefox/4.0b7 

and on IE6 it is:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)

Here, Windows NT 5.1 represents the OS version.


My suggestion is to use Internet Explorer's user agent. And IE's user agent is depending on what software you have installed, by installing download manager, the software will appen its ID into the user agent, for IE & firefox, (depending on the download manager).

To know what is your useragent, in address bar of IE or FF type : javascript:alert(navigator.userAgent)

In the dialog box press Ctrl+C to copy the content


hINetOpen = InternetOpen(_T("SplashID"),  INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);//AK
    if (hINetOpen != NULL){
        hINetConnect = InternetConnect(hINetOpen, sServerName, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, INTERNET_FLAG_IDN_PROXY, 0); 
        if (hINetConnect != NULL){
            hINetRequest = HttpOpenRequest(hINetConnect, _T("POST"), sObjectName, HTTP_VERSION, 0, NULL,  INTERNET_FLAG_RELOAD |INTERNET_FLAG_IGNORE_CERT_CN_INVALID | SECURITY_FLAG_IGNORE_UNKNOWN_CA | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_NO_AUTO_REDIRECT | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_NO_CACHE_WRITE, 0);
            if (hINetRequest != NULL){                      
                if(HttpSendRequest(hINetRequest, strHeaders, strHeaders.GetLength(), (LPVOID) StrFormdata.GetString(), StrFormdata.GetLength())) {
                    CString sBodyText;
                    DWORD nRead= 1024;
                    char szBuf[ 1025 ] = {0};
                    while ( nRead > 0 ) {
                            // Read in a temporary buffer
                        InternetReadFile(hINetRequest, szBuf, 1024, &nRead);
                        szBuf[nRead] = '\0';
                        sBodyText = szBuf;
                        result =  atoi(szBuf);
                        break;  
                    }
                }
            }
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号