Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Fishing for Ideas (C# file copy)

Fishing for Ideas (C# file copy)

Scheduled Pinned Locked Moved C#
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    compninja25
    wrote on last edited by
    #1

    From time to time I would like to have the ability to copy a file through the network to some of our remote locations but control the bandwidth because they have much slower connections. I've used nullsoft's nscopy before, but figured this would be a good learning expierence if I could create my own app to be more fine tuned to my environment. I have a general idea of what I need to do, but am not sure where to start. Looking at the system.IO.file.copy method it doesn't look like there's an overload that controls bandwidth. Then I started to think maybe I need to take the file and create a file stream and pass that through the network somehow, but that's where I get stuck. Has anyone tried doing something like this before? I'm just looking for a nudge in the right direction. Thanks!

    "You're damned if you do, and you're damned if you dont" - Bart Simpson

    L 1 Reply Last reply
    0
    • C compninja25

      From time to time I would like to have the ability to copy a file through the network to some of our remote locations but control the bandwidth because they have much slower connections. I've used nullsoft's nscopy before, but figured this would be a good learning expierence if I could create my own app to be more fine tuned to my environment. I have a general idea of what I need to do, but am not sure where to start. Looking at the system.IO.file.copy method it doesn't look like there's an overload that controls bandwidth. Then I started to think maybe I need to take the file and create a file stream and pass that through the network somehow, but that's where I get stuck. Has anyone tried doing something like this before? I'm just looking for a nudge in the right direction. Thanks!

      "You're damned if you do, and you're damned if you dont" - Bart Simpson

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You're already moving in the right direction :thumbsup: You'd indeed start out with a streamreader and a streamwriter. Instead of filling the stream at once, fill it block by block of data. This will result in a read/write loop that you can throttle if desired. There's a handy sheet-cheat here[^].

      I are troll :)

      C 1 Reply Last reply
      0
      • L Lost User

        You're already moving in the right direction :thumbsup: You'd indeed start out with a streamreader and a streamwriter. Instead of filling the stream at once, fill it block by block of data. This will result in a read/write loop that you can throttle if desired. There's a handy sheet-cheat here[^].

        I are troll :)

        C Offline
        C Offline
        compninja25
        wrote on last edited by
        #3

        AH! Thank you very much for the help and the sheet-cheat eddy! I continued to get stuck because I was aproaching the task thinking I could handle the bandwidth speed from the network side and not the stream reader!

        "You're damned if you do, and you're damned if you dont" - Bart Simpson

        L 1 Reply Last reply
        0
        • C compninja25

          AH! Thank you very much for the help and the sheet-cheat eddy! I continued to get stuck because I was aproaching the task thinking I could handle the bandwidth speed from the network side and not the stream reader!

          "You're damned if you do, and you're damned if you dont" - Bart Simpson

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You're welcome :)

          I are troll :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups