Good approach to calling Urls remotely?

Discussion in 'ASP .Net' started by Jim Bancroft, Aug 15, 2005.

  1. Jim Bancroft

    Jim Bancroft Guest

    Hi,

    I'm porting a web app from VB6 to C#, and one of the things the old
    application did was call a few outside web pages (using http) and act on the
    response stream. Is there a reccomended way to remotely call a URL in .Net,
    a framework class maybe that's best geared toward this? Thanks very much.

    -Jim
     
    Jim Bancroft, Aug 15, 2005
    #1
    1. Advertising

  2. Jim Bancroft

    Lucas Tam Guest

    Lucas Tam, Aug 16, 2005
    #2
    1. Advertising

  3. WebClient client = new WebClient();
    Stream instream = client.OpenRead(URI);
    StreamReader reader = new StreamReader(instream);
    Debug.Write(reader.ReadToEnd());

    or

    byte[] bytes = client.DownloadData(URI);

    --
    Of all words of tongue and pen, the saddest are: "It might have been"

    Bill.Richards @ greyskin .co .uk
    http://greyskin.co.uk


    "Jim Bancroft" wrote:

    >
    > Hi,
    >
    > I'm porting a web app from VB6 to C#, and one of the things the old
    > application did was call a few outside web pages (using http) and act on the
    > response stream. Is there a reccomended way to remotely call a URL in .Net,
    > a framework class maybe that's best geared toward this? Thanks very much.
    >
    > -Jim
    >
    >
    >
     
    =?Utf-8?B?YmlsbHI=?=, Aug 16, 2005
    #3
    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. Soni
    Replies:
    0
    Views:
    1,096
  2. Kaidi
    Replies:
    5
    Views:
    493
    Andrew Thompson
    Jan 4, 2004
  3. Nathan Sokalski

    Converting Relative URLs into Absolute URLs

    Nathan Sokalski, Aug 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    764
    Sriram Srivatsan
    Aug 12, 2008
  4. Adam Monsen

    JDBC URLs ...not really URLs?

    Adam Monsen, Feb 6, 2009, in forum: Java
    Replies:
    11
    Views:
    6,334
    Adam Monsen
    Feb 8, 2009
  5. Steve T.

    dynamic URLS convert to static URLS for search engines

    Steve T., Mar 1, 2004, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    311
    Steve T.
    Mar 4, 2004
Loading...

Share This Page