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. OpenFileDialog Initial Directory FTP Directory - Plz Helpp - 2nd try

OpenFileDialog Initial Directory FTP Directory - Plz Helpp - 2nd try

Scheduled Pinned Locked Moved C#
helptutorial
10 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.
  • L Offline
    L Offline
    laziale
    wrote on last edited by
    #1

    Yesterday I didn't get any reply so maybe today someone can help me: hi guys, I am almost desperate about this, I was trying for whole day yesterday, I want to set the initial directory for OpenFileDialog on FTP folder. How I can do that please help me. If someone knows some example it will be great to share with me. Thx Ahead

    C 1 Reply Last reply
    0
    • L laziale

      Yesterday I didn't get any reply so maybe today someone can help me: hi guys, I am almost desperate about this, I was trying for whole day yesterday, I want to set the initial directory for OpenFileDialog on FTP folder. How I can do that please help me. If someone knows some example it will be great to share with me. Thx Ahead

      C Offline
      C Offline
      Colwin
      wrote on last edited by
      #2

      Try this

      mOpenFileDialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, userName, password);
      mOpenFileDialog.ShowDialog(this);

      Be careful using the username password because if they are wrong the dialog will ask the user for a username password in a pop up

      L 1 Reply Last reply
      0
      • C Colwin

        Try this

        mOpenFileDialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, userName, password);
        mOpenFileDialog.ShowDialog(this);

        Be careful using the username password because if they are wrong the dialog will ask the user for a username password in a pop up

        L Offline
        L Offline
        laziale
        wrote on last edited by
        #3

        no, it doesn't work, I am still getting the my local C;/ directory when the OpenFileDialog popups, I am going through each line in the code, and everything is going smoothly, but when I am expecting to see the requested ftp directory, I am still getting my locak C:/ directory :doh:

        C 1 Reply Last reply
        0
        • L laziale

          no, it doesn't work, I am still getting the my local C;/ directory when the OpenFileDialog popups, I am going through each line in the code, and everything is going smoothly, but when I am expecting to see the requested ftp directory, I am still getting my locak C:/ directory :doh:

          C Offline
          C Offline
          Colwin
          wrote on last edited by
          #4

          Can you post some code? Where you set the dialogs initial directory?

          L 1 Reply Last reply
          0
          • C Colwin

            Can you post some code? Where you set the dialogs initial directory?

            L Offline
            L Offline
            laziale
            wrote on last edited by
            #5

            so it is something like this: I have a button for retrieving files from FTP directory and here is the code what I have in the button click event:

            OpenFileDialog dialog = new OpenFileDialog();
            string server = "someServer";
            string username = "someUser";
            string password = "somePass";
            dialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, username, password);
            dialog.ShowDialog(this);

            L C 2 Replies Last reply
            0
            • L laziale

              so it is something like this: I have a button for retrieving files from FTP directory and here is the code what I have in the button click event:

              OpenFileDialog dialog = new OpenFileDialog();
              string server = "someServer";
              string username = "someUser";
              string password = "somePass";
              dialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, username, password);
              dialog.ShowDialog(this);

              L Offline
              L Offline
              laziale
              wrote on last edited by
              #6

              any help???

              1 Reply Last reply
              0
              • L laziale

                so it is something like this: I have a button for retrieving files from FTP directory and here is the code what I have in the button click event:

                OpenFileDialog dialog = new OpenFileDialog();
                string server = "someServer";
                string username = "someUser";
                string password = "somePass";
                dialog.InitialDirectory = string.Format("ftp://{1}:{2}@{0}", server, username, password);
                dialog.ShowDialog(this);

                C Offline
                C Offline
                Colwin
                wrote on last edited by
                #7

                This should work. If the user name and password are wrong it should prompt you for them Did you step thru the code with the debugger and see whether the initial dir is being set?

                L 1 Reply Last reply
                0
                • C Colwin

                  This should work. If the user name and password are wrong it should prompt you for them Did you step thru the code with the debugger and see whether the initial dir is being set?

                  L Offline
                  L Offline
                  laziale
                  wrote on last edited by
                  #8

                  yep, it shows me. Initial Directory is:

                  "ftp://myUserName:myPassword@myFTPaddress"

                  C 1 Reply Last reply
                  0
                  • L laziale

                    yep, it shows me. Initial Directory is:

                    "ftp://myUserName:myPassword@myFTPaddress"

                    C Offline
                    C Offline
                    Colwin
                    wrote on last edited by
                    #9

                    Ok are you sure you are not setting it again after that??

                    L 1 Reply Last reply
                    0
                    • C Colwin

                      Ok are you sure you are not setting it again after that??

                      L Offline
                      L Offline
                      laziale
                      wrote on last edited by
                      #10

                      no..after that I have just ShowDialog(), and I have the OpenFileDialog displayed

                      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