VC settings cookies to achieve file brush Download volume

Source: Internet
Author: User

VC settings cookies to achieve file brush Download volume

VC Settings cookies to achieve file brush Download VolumeCategory:2013-10-11 17:22 250 people reading reviews (0) favorite reports

Directory (?) [+]

Classmate XXX Questions:

Hello everyone, our Android app has been successfully listed in ZTE World, open the "ZTE World App Store" http://apps.ztems.com/, search bar search "Rui Cloud" can be found, but you need to register a store account, you can download after the completion of the , you can also give us a comment. The simplest brush download volume please directly click http://dl5.ztems.com/tmpfile/cst2009/2009001/appSoft/2013/10/9/ruiyun.apk (test can download, cannot increase the download volume)
Both of the above methods can be, the first better, the second can also. But in the free time we still recommend the first kind. XXX Here thank you for your help.

--------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------

Similar to the app download site, is not to verify the IP, not to verify the Mac, to achieve just let a client download once. (Authentication IP, we can use proxy IP to achieve the purpose of our brush download volume)

Impersonate a login and see how the server handles user requests.

Using the capture software to monitor:

[Plain]View Plaincopy
  1. POST/STOREUSERBASICFACADE/LOGIN.SSM http/1.1
  2. Host:apps.ztems.com
  3. Connection:keep-alive
  4. content-length:72
  5. Origin:http://apps.ztems.com
  6. user-agent:mozilla/5.0 (Windows NT 6.2; WOW64) applewebkit/537.36 (khtml, like Gecko) chrome/30.0.1599.69 safari/537.36
  7. Content-type:text/plain;charset=utf-8
  8. Accept: */*
  9. Referer:http://apps.ztems.com/newlogin.html
  10. Accept-encoding:gzip,deflate,sdch
  11. accept-language:zh-cn,zh;q=0.8
  12. cookie:jsessionid=811b619fa8744978b07238a82f1e6a8b.app42-1; zte_store_view=4028329f417e6dcd01419d5dafa21aa3-1131011170551%2c
  13. [{"Email": "******", "userpasswd": "* * *", "Checkcode": "3367"}]

Http://apps.ztems.com/newLogin.html

/storeuserbasicfacade/login.ssm

This kind of thing does not know how to deal with it because of the limited level, so we start with the cookies.

With cookies we can easily get around the background and log in.

Then use VC to achieve the above operation, using the win API

InternetSetCookie

Syntaxc++
BOOL InternetSetCookie (  _in_ lpctstr lpszurl,  _in_ lpctstr lpszcookiename,  _in_ lpctstr lpszcookiedata);
Parameters
Lpszurl [In]

Pointer to a null-terminated string, specifies the URL for which the cookie should is set.

Lpszcookiename [In]

Pointer to a null-terminated string, specifies the name to is associated with the cookie data. If This parameter are NULL, no name is associated with the cookie.

Lpszcookiedata [In]

Pointer to the actual data to is associated with the URL.

Return value

Returns TRUE If successful, or FALSE otherwise. To get a specific error message, call GetLastError.

Remarks

Cookies created by InternetSetCookie without a expiration date is stored in memory and is available only in th E same process that created them. The Cookies include an expiration date is stored in the Windows\Cookies directory.

Creating a new cookie might cause a dialog box to appear on the screens asking the user if they want to allow or disallow C Ookies from this site based on the privacy settings for the user.

Caution InternetSetCookie would unconditionally create a cookie even if "Block all Cookies" are set in Internet Ex Plorer. This behavior can viewed as a breach of privacy even though such cookies is not subsequently sent back to servers Whil E The ' Block All Cookies ' setting is active. Applications should use Internetsetcookieex to correctly honor the user ' s privacy settings.

For more cookies internals, see http://blogs.msdn.com/ieinternals/archive/2009/08/20/WinINET-IE-Cookie-Internals-FAQ.aspx.

Aspects of the WinINet API, this function cannot is safely called from within DllMain or the constructors a nd destructors of global objects.

Note WinINet does not a support server implementations. In addition, it should is used from a service. For server implementations or services, use Microsoft Windows HTTP Services (WinHTTP).

[CPP]View Plaincopy
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <afxinet.h>
  4. Using namespace std;
  5. CString gethtml (CString URL)
  6. {
  7. CString content;
  8. CString data;
  9. DWORD Dwstatuscode;
  10. CInternetSession session (TEXT ("HttpClient"));
  11. chttpfile* pfile = (CHttpFile *) session. OpenURL (URL);
  12. Pfile->queryinfostatuscode (Dwstatuscode);
  13. if (Dwstatuscode = = HTTP_STATUS_OK)
  14. {
  15. While (pfile->readstring (data))
  16. {
  17. Content + = data;
  18. }
  19. }
  20. Pfile->close ();
  21. Delete pfile;
  22. Session. Close ();
  23. return content;
  24. }
  25. int main ()
  26. {
  27. CString url = "Http://apps.ztems.com/fdpc?appcode=4028329f417e6dcd01419d5dafa21aa3";
  28. InternetSetCookie (URL, NULL, TEXT ("jsessionid=811b619fa8744978b07238a82f1e6a8b.app42-1;  zte_store_view=;expires=sat,01-jan-2014 00:00:00gmt "));
  29. gethtml (URL);
  30. }

VC settings cookies to achieve file brush Download volume

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.