Re: How to Spoof Referer URL

Discussion in 'ASP .Net' started by dave wanta, Jul 6, 2003.

  1. dave wanta

    dave wanta Guest

    you mean like?
    (this is some old beta1 code i wrote years ago, don't know if all the
    classes are still named appropriately, as I haven't used it since i wrote
    it.)

    Function FetchURL(SomeURL as String) as String
    Dim WebResp as HTTPWebresponse
    Dim HTTPGetRequest as HttpWebRequest
    Dim sr As StreamReader
    dim myString as String

    HTTPGetRequest = WebRequestFactory.Create(SomeURL)
    HTTPGetRequest.KeepAlive = false
    HTTPGetRequest.Referer = "http://www.microsoft.com"
    WebResp = HTTPGetRequest.GetResponse()
    sr = new StreamReader(WebResp.GetResponseStream(), Encoding.ASCII)
    myString = sr.ReadToEnd()

    Return myString
    End Function

    Cheers!
    Dave
    www.aspNetEmail.com


    "Admin" <> wrote in message
    news:...
    > Hi There
    >
    > Can someone tell me how to do this using .net??
    > Thanks.
    >
    > Henry
    dave wanta, Jul 6, 2003
    #1
    1. Advertising

  2. dave wanta

    Admin Guest

    Yes. Precisely like that. Thank you.

    "dave wanta" <> wrote in message news:<>...
    > you mean like?
    > (this is some old beta1 code i wrote years ago, don't know if all the
    > classes are still named appropriately, as I haven't used it since i wrote
    > it.)
    >
    > Function FetchURL(SomeURL as String) as String
    > Dim WebResp as HTTPWebresponse
    > Dim HTTPGetRequest as HttpWebRequest
    > Dim sr As StreamReader
    > dim myString as String
    >
    > HTTPGetRequest = WebRequestFactory.Create(SomeURL)
    > HTTPGetRequest.KeepAlive = false
    > HTTPGetRequest.Referer = "http://www.microsoft.com"
    > WebResp = HTTPGetRequest.GetResponse()
    > sr = new StreamReader(WebResp.GetResponseStream(), Encoding.ASCII)
    > myString = sr.ReadToEnd()
    >
    > Return myString
    > End Function
    >
    > Cheers!
    > Dave
    > www.aspNetEmail.com
    >
    >
    > "Admin" <> wrote in message
    > news:...
    > > Hi There
    > >
    > > Can someone tell me how to do this using .net??
    > > Thanks.
    > >
    > > Henry
    Admin, Jul 7, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rune
    Replies:
    4
    Views:
    1,798
  2. Chris Ianson
    Replies:
    1
    Views:
    384
    David Dorward
    Apr 1, 2006
  3. Replies:
    3
    Views:
    6,988
  4. JohnW-Mpls

    Spoof URL before Bookmark save?

    JohnW-Mpls, Dec 20, 2007, in forum: HTML
    Replies:
    3
    Views:
    399
    Bone Ur
    Dec 20, 2007
  5. referer url

    , Jan 28, 2008, in forum: Python
    Replies:
    4
    Views:
    490
Loading...

Share This Page