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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. copy file in vb.net

copy file in vb.net

Scheduled Pinned Locked Moved Visual Basic
csharptutorial
5 Posts 4 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.
  • F Offline
    F Offline
    faravani
    wrote on last edited by
    #1

    hi for all I want select a file in my disk by openfiledialog tool in vb.net then copy selected file in a special path with any format please guide me thanks.

    L 1 Reply Last reply
    0
    • F faravani

      hi for all I want select a file in my disk by openfiledialog tool in vb.net then copy selected file in a special path with any format please guide me thanks.

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

      faravani wrote:

      hi for all

      Goodmorning :)

      faravani wrote:

      I want select a file in my disk by openfiledialog tool in vb.net

      That's done using the [OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx "New Window")] class. Call it's ShowDialog method to show it, and retrieve the path of the file that the user selected using it's [FileName](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx "New Window")] property.

      faravani wrote:

      then copy selected file

      That's done using the [Copy](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx)[[^](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx "New Window")] method of the File class. Do remember to check the exceptions that it might throw.

      faravani wrote:

      in a special path

      You can use each directory. If you need to fetch the directory of a folder, consider using the [GetFolderPath](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx "New Window")] method :)

      faravani wrote:

      with any format

      It would copy the data there, provided that it's accessible (you have the appropriate rights, not locked by another process etc.) Hope this helps :)

      Bastard Programmer from Hell :suss:

      W S 2 Replies Last reply
      0
      • L Lost User

        faravani wrote:

        hi for all

        Goodmorning :)

        faravani wrote:

        I want select a file in my disk by openfiledialog tool in vb.net

        That's done using the [OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx "New Window")] class. Call it's ShowDialog method to show it, and retrieve the path of the file that the user selected using it's [FileName](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx "New Window")] property.

        faravani wrote:

        then copy selected file

        That's done using the [Copy](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx)[[^](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx "New Window")] method of the File class. Do remember to check the exceptions that it might throw.

        faravani wrote:

        in a special path

        You can use each directory. If you need to fetch the directory of a folder, consider using the [GetFolderPath](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx "New Window")] method :)

        faravani wrote:

        with any format

        It would copy the data there, provided that it's accessible (you have the appropriate rights, not locked by another process etc.) Hope this helps :)

        Bastard Programmer from Hell :suss:

        W Offline
        W Offline
        Wayne Gaylard
        wrote on last edited by
        #3

        Cannot get any clearer than that .:)

        ...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....

        1 Reply Last reply
        0
        • L Lost User

          faravani wrote:

          hi for all

          Goodmorning :)

          faravani wrote:

          I want select a file in my disk by openfiledialog tool in vb.net

          That's done using the [OpenFileDialog](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx "New Window")] class. Call it's ShowDialog method to show it, and retrieve the path of the file that the user selected using it's [FileName](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx "New Window")] property.

          faravani wrote:

          then copy selected file

          That's done using the [Copy](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx)[[^](http://msdn.microsoft.com/en-us/library/c6cfw35a.aspx "New Window")] method of the File class. Do remember to check the exceptions that it might throw.

          faravani wrote:

          in a special path

          You can use each directory. If you need to fetch the directory of a folder, consider using the [GetFolderPath](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx "New Window")] method :)

          faravani wrote:

          with any format

          It would copy the data there, provided that it's accessible (you have the appropriate rights, not locked by another process etc.) Hope this helps :)

          Bastard Programmer from Hell :suss:

          S Offline
          S Offline
          Smithers Jones
          wrote on last edited by
          #4

          :thumbsup: Good answer.

          "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

          L 1 Reply Last reply
          0
          • S Smithers Jones

            :thumbsup: Good answer.

            "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

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

            Thanx :)

            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