BMR318 Posted April 9, 2018 at 08:55 PM Report #610151 Posted April 9, 2018 at 08:55 PM Boas, Estou a tentar criar uma textbox, em que clicando num button, abre uma janela para seleccionar uma pasta de destino e apresenta o caminho completo na textbox. Estou a usar o seguinte código: private void btnSelectFolder_Click(object sender, EventArgs e) { FolderBrowserDialog OpenFolder = new FolderBrowserDialog(); OpenFolder.ShowDialog(); if (OpenFolder.SelectedPath != null) { txtSelectFolder.Text = OpenFolder.ToString(); } No entanto, o resultado que obtenho na textbox é: System.Windows.Forms.FolderBrowserDialog Alguém tem alguma ideia que me possa ajudar??
M6 Posted April 10, 2018 at 10:21 AM Report #610156 Posted April 10, 2018 at 10:21 AM O que tu queres não é o ToString (isso é uma "representação" do objeto para String), o que tu queres é o SelectedPath que já usas acima. Lê a documentação que vais perceber. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar."
Karbust Posted June 26, 2018 at 10:10 PM Report #611140 Posted June 26, 2018 at 10:10 PM Eu uso da seguinte forma para escolher a localização do ficheiro de backup da db mysql: FolderBrowserDialog browserDialog = new FolderBrowserDialog(); if (browserDialog.ShowDialog() == DialogResult.OK) { _mysqlFunctions.MysqlDatabaseBackupExport(browserDialog.SelectedPath); } O que te interessa daí é o browserDialog.SelectedPath Se for para guardar um ficheiro nessa localização, adicionas isto ao resultado do SelectedPath: browserDialog.SelectedPath+"\\nomedoficheiro.txt"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now