.net - HttpWebRequest - Redirect -
i html
code page: http://trendstop.knack.be/nl/detail/446121707/6x-international.aspx each time make html
request using:
imports system imports system.io imports system.web imports system.net imports system.io.isolatedstorage imports system.threading imports microsoft.visualbasic imports system.text public class getsource function gethtml(byval strpage string) string dim strreply string = "null" try dim objhttprequest system.net.httpwebrequest dim objhttpresponse system.net.httpwebresponse objhttprequest = system.net.httpwebrequest.create(strpage) objhttpresponse = objhttprequest.getresponse dim objstrmreader new streamreader(objhttpresponse.getresponsestream) strreply = objstrmreader.readtoend() catch ex exception strreply = "error! " + ex.message.tostring end try return strreply end function end class
i html of redirected url http://trendstop.knack.be/nl/detail/446121707/6x-international/activity.aspx
how can obtain html code of original url
?
perhaps set allowautoredirect property 'false'?
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.allowautoredirect.aspx
Comments
Post a Comment