Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

HttpWebRequest Class - Previous Adfly

This is regarding a post i made today regarding the class which can be found Here. A member earlier posted a request example jumping between WebClient and the http class Here. The WebClient is a wrapper for the HttpWebRequest Class and sends a request internally with less control. If we need finer control we use the class.

Please can we stop posting HttpWebRequest examples if we have never read any of the documentation. If you have read my post i clearly state i am no expert but i have written a few projects in the past for friends. I have no use for the class. It's not just about creating a request. It's knowing what to look for and also knowing HTTP. People suggest using a third party addon like Live HTTP headers but what do you think the response contains?

If the OP had read the documentation and all the sub sections HttpWebResponse.Headers Property they would no how to get the response location. MSDN does contain examples so please read them.

Code
Header Name:Connection, Value :close
Header Name:Pragma, Value :no-cache
Header Name:Content-Length, Value :0
Header Name:Cache-Control, Value :no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Header Name:Content-Type, Value :text/html
Header Name:Date, Value :Wed, 19 Dec 2012 00:35:00 GMT
Header Name:Expires, Value :Thu, 19 Nov 1981 08:52:00 GMT
Header Name:Location, Value :https://hackforums.net
Header Name:Set-Cookie, Value :PHPSESSID=47a36e39533660810cf426c5a79bdcad; path=/
Header Name:Server, Value :LiteSpeed
Header Name:X-Powered-By, Value :PHP/5.3.8

All we simply need to do is request the adfly link, collect the link token, SET AUTOREDIRECT to false and get the response headers. No parsing. Which no One seems to validate before parsing any way. Constant indexoutofrange exceptions.

[Image: 70b024252420be3ed9a9ee5b35c3141b.png]

The full Project can be downloaded here

http://www.freefilehosting.net/adfly

http://pastebin.com/nFg6MMyN

Interesting, i am actually being helpful today :S
When you set the .UserAgent property, you don't need to include "User-Agent" in the string. I have not downloaded your source but I am talking about the picture.

Code
.UserAgent = "User-Agent"", ""Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0"

should be

Code
.UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0"
Correct. It's a small over sight typing and if you view my other post regarding you will see this. It's regardless to the point.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by HardStoNMay 2, 2021 12:59 AM 5 269 May 2, 2021 12:59 AM
Last Post: vaiperboy
[C] by lockheadApr 22, 2021 07:10 AM 0 147 Apr 22, 2021 07:10 AM
Last Post: lockhead
[C#] by draxyeeSep 10, 2019 01:37 PM 12 389 Sep 10, 2019 01:37 PM
Last Post: MavenGradle