Downloading files from URL address from within C# Windows Applicat

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VG9kZCBKYXNwZXJz?=

    Downloading files from URL address from within C# Windows Applicat

    Hey guys,

    I'm trying to consider my options. Does anyone here know of a way
    that I can basically download or copy locally a file from the internet with
    having nothing more than the URL? Basically, lets say there is a PDF file at
    http://www.somewebsite.com/thefile.pdf, is there any way possible for me
    (without the interaction of a user), to download and retrieve this file
    locally?


    Thanks guys!!!

    Todd
  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Downloading files from URL address from within C# WindowsApplicat

    On Jun 3, 9:18 am, Todd Jaspers
    <ToddJasp...@di scussions.micro soft.comwrote:
     Hey guys,
    >
           I'm trying to consider my options. Does anyone here know ofa way
    that I can basically download or copy locally a file from the internet with
    having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
    (without the interaction of a user), to download and retrieve this file
    locally?
    >
    Thanks guys!!!
    >
    Todd
    Hi,

    Yesterday was a post about this (with code included), take a look into
    the archives

    Comment

    • Marc Gravell

      #3
      Re: Downloading files from URL address from within C# WindowsApplicat

      using (WebClient client = new WebClient()) {
      client.Download File(url, dest);
      }

      Marc

      Comment

      • Ignacio Machin ( .NET/ C# MVP )

        #4
        Re: Downloading files from URL address from within C# WindowsApplicat

        On Jun 3, 9:39 am, "Ignacio Machin ( .NET/ C# MVP )"
        <ignacio.mac... @gmail.comwrote :
        On Jun 3, 9:18 am, Todd Jaspers
        >
        <ToddJasp...@di scussions.micro soft.comwrote:
         Hey guys,
        >
               I'm trying to consider my options. Does anyone here know of a way
        that I can basically download or copy locally a file from the internet with
        having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
        (without the interaction of a user), to download and retrieve this file
        locally?
        >
        Thanks guys!!!
        >
        Todd
        >
        Hi,
        >
        Yesterday was a post about this (with code included), take a look into
        the archives
        This is the code from yesteday

        HttpWebRequest request =
        (HttpWebRequest )WebRequest.Cre ate("http://
        est.rbma.com/content/Hagar_The_Horri ble?date=200805 30");

        request.GetResp onse().GetRespo nseStream();

        now you have your stream, you can do with it what you want.

        Comment

        • kimiraikkonen

          #5
          Re: Downloading files from URL address from within C# WindowsApplicat

          On Jun 3, 4:18 pm, Todd Jaspers
          <ToddJasp...@di scussions.micro soft.comwrote:
          Hey guys,
          >
          I'm trying to consider my options. Does anyone here know of a way
          that I can basically download or copy locally a file from the internet with
          having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
          (without the interaction of a user), to download and retrieve this file
          locally?
          >
          Thanks guys!!!
          >
          Todd
          Hi,
          Just use WebClient's DownloadFile method.

          Hope this helps,

          Onur Güzel

          Comment

          • =?Utf-8?B?VG9kZCBKYXNwZXJz?=

            #6
            Re: Downloading files from URL address from within C# Windows Appl

            Dude! Kimi Raikonen is awesome!!! I was sooo happy to see him with the
            championship last year. He is clearly a better driver than anyone else in
            Formula-1. He had some issues in the beginning of the season with drinking
            and partying too much with the ladies before each race, but he clearly has
            more skill. Sucks about Monaco this year, but I just know he's going to do
            awesome again this season.

            Seems to be a trend with Finnish drivers... Mikka Hakkonen, Nikolai
            Makkinen, Heiki Kovalainen, etc... a lot of "nen"s...





            "kimiraikko nen" wrote:
            On Jun 3, 4:18 pm, Todd Jaspers
            <ToddJasp...@di scussions.micro soft.comwrote:
            Hey guys,

            I'm trying to consider my options. Does anyone here know of a way
            that I can basically download or copy locally a file from the internet with
            having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
            (without the interaction of a user), to download and retrieve this file
            locally?

            Thanks guys!!!

            Todd
            >
            Hi,
            Just use WebClient's DownloadFile method.
            >
            Hope this helps,
            >
            Onur Güzel
            >

            Comment

            • =?Utf-8?B?VG9kZCBKYXNwZXJz?=

              #7
              RE: Downloading files from URL address from within C# Windows Applicat

              Thanks guys, I appreciate it. I double posted. I posted on here as well as
              the forums (probably shouldn't). I do appreciate all the help. Marc helped me
              out in the C# Forums.


              Thanks!

              Todd

              Comment

              • kimiraikkonen

                #8
                Re: Downloading files from URL address from within C# Windows Appl

                On Jun 3, 8:10 pm, Todd Jaspers
                <ToddJasp...@di scussions.micro soft.comwrote:
                Dude! Kimi Raikonen is awesome!!! I was sooo happy to see him with the
                championship last year.  He is clearly a better driver than anyone else in
                Formula-1. He had some issues in the beginning of the season with drinking
                and partying too much with the ladies before each race, but he clearly has
                more skill. Sucks about Monaco this year, but I just know he's going to do
                awesome again this season.
                >
                Seems to be a trend with Finnish drivers... Mikka Hakkonen, Nikolai
                Makkinen, Heiki Kovalainen, etc... a lot of "nen"s...
                >
                >
                >
                "kimiraikko nen" wrote:
                On Jun 3, 4:18 pm, Todd Jaspers
                <ToddJasp...@di scussions.micro soft.comwrote:
                 Hey guys,
                >
                       I'm trying to consider my options. Does anyone here know of a way
                that I can basically download or copy locally a file from the internetwith
                having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
                (without the interaction of a user), to download and retrieve this file
                locally?
                >
                Thanks guys!!!
                >
                Todd
                >
                Hi,
                Just use WebClient's DownloadFile method.
                >
                Hope this helps,
                >
                Onur Güzel- Hide quoted text -
                >
                - Show quoted text -
                LOL. I support him, too. He had so many unlucky races until he drives
                for Ferrari plus last race Monaco, unlucky accident with Sutil... and
                however i don't think or i don't know if there's Nikolai Makkinen.

                Thanks for your thoughts :)


                Onur

                Comment

                • =?Utf-8?B?VG9kZCBKYXNwZXJz?=

                  #9
                  Re: Downloading files from URL address from within C# Windows Appl

                  Nikolai Makinen was a really good rally driver back in the late 60s / early
                  70s. I may have his first name a bit wrong, but I know his last name is
                  correct. I think there's a newer Makinen in Rally presently, but I don't know
                  if they're related.


                  Todd

                  "kimiraikko nen" wrote:
                  On Jun 3, 8:10 pm, Todd Jaspers
                  <ToddJasp...@di scussions.micro soft.comwrote:
                  Dude! Kimi Raikonen is awesome!!! I was sooo happy to see him with the
                  championship last year. He is clearly a better driver than anyone else in
                  Formula-1. He had some issues in the beginning of the season with drinking
                  and partying too much with the ladies before each race, but he clearly has
                  more skill. Sucks about Monaco this year, but I just know he's going to do
                  awesome again this season.

                  Seems to be a trend with Finnish drivers... Mikka Hakkonen, Nikolai
                  Makkinen, Heiki Kovalainen, etc... a lot of "nen"s...



                  "kimiraikko nen" wrote:
                  On Jun 3, 4:18 pm, Todd Jaspers
                  <ToddJasp...@di scussions.micro soft.comwrote:
                  Hey guys,
                  I'm trying to consider my options. Does anyone here know of a way
                  that I can basically download or copy locally a file from the internet with
                  having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
                  (without the interaction of a user), to download and retrieve this file
                  locally?
                  Thanks guys!!!
                  Todd
                  Hi,
                  Just use WebClient's DownloadFile method.
                  Hope this helps,
                  Onur Güzel- Hide quoted text -
                  - Show quoted text -
                  >
                  LOL. I support him, too. He had so many unlucky races until he drives
                  for Ferrari plus last race Monaco, unlucky accident with Sutil... and
                  however i don't think or i don't know if there's Nikolai Makkinen.
                  >
                  Thanks for your thoughts :)
                  >
                  >
                  Onur
                  >

                  Comment

                  • kimiraikkonen

                    #10
                    Re: Downloading files from URL address from within C# Windows Appl

                    On Jun 3, 8:51 pm, Todd Jaspers
                    <ToddJasp...@di scussions.micro soft.comwrote:
                    Nikolai Makinen was a really good rally driver back in the late 60s / early
                    70s. I may have his first name a bit wrong, but I know his last name is
                    correct. I think there's a newer Makinen in Rally presently, but I don't know
                    if they're related.
                    >
                    Todd
                    >
                    >
                    >
                    "kimiraikko nen" wrote:
                    On Jun 3, 8:10 pm, Todd Jaspers
                    <ToddJasp...@di scussions.micro soft.comwrote:
                    Dude! Kimi Raikonen is awesome!!! I was sooo happy to see him with the
                    championship last year.  He is clearly a better driver than anyone else in
                    Formula-1. He had some issues in the beginning of the season with drinking
                    and partying too much with the ladies before each race, but he clearlyhas
                    more skill. Sucks about Monaco this year, but I just know he's going to do
                    awesome again this season.
                    >
                    Seems to be a trend with Finnish drivers... Mikka Hakkonen, Nikolai
                    Makkinen, Heiki Kovalainen, etc... a lot of "nen"s...
                    >
                    "kimiraikko nen" wrote:
                    On Jun 3, 4:18 pm, Todd Jaspers
                    <ToddJasp...@di scussions.micro soft.comwrote:
                     Hey guys,
                    >
                           I'm trying to consider my options. Does anyone hereknow of a way
                    that I can basically download or copy locally a file from the internet with
                    having nothing more than the URL? Basically, lets say there is a PDF file athttp://www.somewebsite .com/thefile.pdf, is there any way possible for me
                    (without the interaction of a user), to download and retrieve thisfile
                    locally?
                    >
                    Thanks guys!!!
                    >
                    Todd
                    >
                    Hi,
                    Just use WebClient's DownloadFile method.
                    >
                    Hope this helps,
                    >
                    Onur Güzel- Hide quoted text -
                    >
                    - Show quoted text -
                    >
                    LOL. I support him, too. He had so many unlucky races until he drives
                    for Ferrari plus last race Monaco, unlucky accident with Sutil... and
                    however i don't think or i don't know if there's Nikolai Makkinen.
                    >
                    Thanks for your thoughts :)
                    >
                    Onur- Hide quoted text -
                    >
                    - Show quoted text -
                    You probably meant Timo Makinen for 70s and his successor Tommi
                    Makinen who is retired in 2003. :)

                    Onur

                    Comment

                    Working...