Sunday, 30 December 2012

Source: [VB.NET] winAPI(wininet library) -Get page source [Example]

I previously wrote a FTP Class totally based on win API's, located here:  http://loyaltyhf.blogspot.com/2012/11/source-pure-win32-apis-ftp-class.html
So i decided to finger HTTP protocol via win APIs so here is what i pulled of real quick. Its just an example for using win API calls in .NET i don't recommend using it this can be done in just one line  using .NET.




Download: http://puu.sh/1HiJC

Thursday, 13 December 2012

Source: Saving/Loading/Using cookies from a file [Example][HTTPWebRequest]

So yeah...i was working on a project i have to test a few features but i have to login every time i start my application but the website started "No No" after three consecutive loggins so i came up with the idea of saving session cookies to a file and loading 'em to login...

I decided to put an example togetter for you guys!

So this is how it works...save the "Global Cookie" container to a file via a structure along with other session info using serilization(i'm using binary) and load 'em everytime you need to login from that particular file("*.cok" in my case)....it's like webrequest based simulation of the "Remember Me" thing.

It can be also be used to use the same cookies for different applications...you can use the binder class to do that(in case you are willing to use the binary serialization :3)
you can also encrypt the cookies before saving them to the file and decrypt 'em back for using.

I'm using gamerage.com as an example(i wrote the example a while back for some dude just modifying it to save/load session cookies)



 Source Code: http://puu.sh/1AyEq