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. To search and copy from server

To search and copy from server

Scheduled Pinned Locked Moved C#
sysadminquestion
9 Posts 5 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.
  • P Offline
    P Offline
    P_Elza
    wrote on last edited by
    #1

    I want to search a file from server and want to copy it to the local disk. how it is done?

    L R 2 Replies Last reply
    0
    • P P_Elza

      I want to search a file from server and want to copy it to the local disk. how it is done?

      L Offline
      L Offline
      laddie 0
      wrote on last edited by
      #2

      You can search for a file.using Directory.GetFiles(FileName,SearchPattern); And copy to local system using ftp request and response classes in System.Net. Mean while what is your application is a client server apps or a web applicaiton ?

      P 1 Reply Last reply
      0
      • L laddie 0

        You can search for a file.using Directory.GetFiles(FileName,SearchPattern); And copy to local system using ftp request and response classes in System.Net. Mean while what is your application is a client server apps or a web applicaiton ?

        P Offline
        P Offline
        P_Elza
        wrote on last edited by
        #3

        My application is to search the particular element from an xml file and to search a file with that name in server. and i have to copy the same file to my local disk. I tried to searc using using Directory.GetFiles(FileName,SearchPattern); but it is not at all serching.

        P J 2 Replies Last reply
        0
        • P P_Elza

          My application is to search the particular element from an xml file and to search a file with that name in server. and i have to copy the same file to my local disk. I tried to searc using using Directory.GetFiles(FileName,SearchPattern); but it is not at all serching.

          P Offline
          P Offline
          P_Elza
          wrote on last edited by
          #4

          Plz help me for the above..............

          1 Reply Last reply
          0
          • P P_Elza

            My application is to search the particular element from an xml file and to search a file with that name in server. and i have to copy the same file to my local disk. I tried to searc using using Directory.GetFiles(FileName,SearchPattern); but it is not at all serching.

            J Offline
            J Offline
            Joe 2
            wrote on last edited by
            #5

            P_Elza wrote:

            not at all serching

            Hope you are checking if the directory is existing using Directory.Exists ?

            P_Elza wrote:

            search the particular element from an xml file

            Are the innertext's value assigned to the intended variables? Probably debugging the app will help you understand where it fails.

            P 1 Reply Last reply
            0
            • J Joe 2

              P_Elza wrote:

              not at all serching

              Hope you are checking if the directory is existing using Directory.Exists ?

              P_Elza wrote:

              search the particular element from an xml file

              Are the innertext's value assigned to the intended variables? Probably debugging the app will help you understand where it fails.

              P Offline
              P Offline
              P_Elza
              wrote on last edited by
              #6

              Tis is working if the file is in my hard disk itself. but not when it comes to server. If i map the server i can search.like y:\\my folder\\myfolder am tring to make an exe. different people will map to different drive. so i cant give like that.should give like \\server\\serverfolde\\folder\\

              P 1 Reply Last reply
              0
              • P P_Elza

                I want to search a file from server and want to copy it to the local disk. how it is done?

                R Offline
                R Offline
                rohitsrivastava
                wrote on last edited by
                #7

                hi you can take the toolbox from openfiledialogbox1

                P 1 Reply Last reply
                0
                • R rohitsrivastava

                  hi you can take the toolbox from openfiledialogbox1

                  P Offline
                  P Offline
                  P_Elza
                  wrote on last edited by
                  #8

                  I am tring to make an exe.

                  1 Reply Last reply
                  0
                  • P P_Elza

                    Tis is working if the file is in my hard disk itself. but not when it comes to server. If i map the server i can search.like y:\\my folder\\myfolder am tring to make an exe. different people will map to different drive. so i cant give like that.should give like \\server\\serverfolde\\folder\\

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    Well, that will never work because a server must start with a double slash, so in your syntax this would be \\\\server\\serverfolde\\folder\\. You can, of course, prefix this with the @ sign so this becomes @"\\server\serverfolde\folder\". Now, your application will need to have permissions to work with these folders - make sure that it has the permissions to do this.

                    Deja View - the feeling that you've seen this post before.

                    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