OpenFileDialog Initial Directory FTP Directory - Plz Helpp - 2nd try
-
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
-
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
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
-
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
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:
-
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:
-
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); -
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); -
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); -
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?
yep, it shows me. Initial Directory is:
-
yep, it shows me. Initial Directory is: