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. System.IO Copy() and Move() question

System.IO Copy() and Move() question

Scheduled Pinned Locked Moved C#
questionhelptutorial
7 Posts 3 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.
  • V Offline
    V Offline
    vlusardi
    wrote on last edited by
    #1

    MSDN help says you can use a UNC path for any methods that accept a path, and I'm wondering if I can also substitute an IP address for the UNC....??? Example: Using System.IO.File.Move() File.Move("\\\\MyServer\\share\\dir\\myfile.txt", "\\\\YourServer\\share\\dir\\myfile.txt"); Should I also be able to use IP address like this?: File.Move("http://192.168.1.1\\share\\dir\\myfile.txt", "http://192.166.1.3\\share\\dir\\myfile.txt"); thanks for your input... vince

    N 1 Reply Last reply
    0
    • V vlusardi

      MSDN help says you can use a UNC path for any methods that accept a path, and I'm wondering if I can also substitute an IP address for the UNC....??? Example: Using System.IO.File.Move() File.Move("\\\\MyServer\\share\\dir\\myfile.txt", "\\\\YourServer\\share\\dir\\myfile.txt"); Should I also be able to use IP address like this?: File.Move("http://192.168.1.1\\share\\dir\\myfile.txt", "http://192.166.1.3\\share\\dir\\myfile.txt"); thanks for your input... vince

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      On the network you shouldn't have to include the "http://" portion, but you can use the IP address of the server, usually. -Nick Parker

      V 1 Reply Last reply
      0
      • N Nick Parker

        On the network you shouldn't have to include the "http://" portion, but you can use the IP address of the server, usually. -Nick Parker

        V Offline
        V Offline
        vlusardi
        wrote on last edited by
        #3

        thanks for the reply.... so I could do something like: "\\\\192.168.1.1\\myshare\\dir\file.txt" ??? thanks for your input..

        N 1 Reply Last reply
        0
        • V vlusardi

          thanks for the reply.... so I could do something like: "\\\\192.168.1.1\\myshare\\dir\file.txt" ??? thanks for your input..

          N Offline
          N Offline
          Nick Parker
          wrote on last edited by
          #4

          vlusardi wrote: "\\\\192.168.1.1\\myshare\\dir\file.txt" ??? Yes, but you would only use two backwards slashes before the I.P. Address. -Nick Parker

          V N 2 Replies Last reply
          0
          • N Nick Parker

            vlusardi wrote: "\\\\192.168.1.1\\myshare\\dir\file.txt" ??? Yes, but you would only use two backwards slashes before the I.P. Address. -Nick Parker

            V Offline
            V Offline
            vlusardi
            wrote on last edited by
            #5

            Nick, thanks for the clarification... I'll be trying it out soon...

            1 Reply Last reply
            0
            • N Nick Parker

              vlusardi wrote: "\\\\192.168.1.1\\myshare\\dir\file.txt" ??? Yes, but you would only use two backwards slashes before the I.P. Address. -Nick Parker

              N Offline
              N Offline
              Nathan Blomquist
              wrote on last edited by
              #6

              Ummm... if this is c++ or c# (non-literal string so things need to be escaped) you would need the double slashes, hence four slashes at the beginning... Sorry, I being nit-picky.... -Nathan --------------------------- Hmmm... what's a signature?

              N 1 Reply Last reply
              0
              • N Nathan Blomquist

                Ummm... if this is c++ or c# (non-literal string so things need to be escaped) you would need the double slashes, hence four slashes at the beginning... Sorry, I being nit-picky.... -Nathan --------------------------- Hmmm... what's a signature?

                N Offline
                N Offline
                Nick Parker
                wrote on last edited by
                #7

                Well, with C# you could use a verbatim string with an @ in front of it and you would only need two backwards slashes. ;) -Nick Parker

                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