Exclamation[Help]SupportMultiDottedExtensions[Solved]

Posts 1–15 of 32 · Page 1 of 3
[Help]SupportMultiDottedExtensions[Solved]
For using an OpenFileDialog, you can SupportMultiDottedExtensions. So the code would be:

Code:
OpenFileDialog1.SupportMultiDottedExtensions = True
But, when I try to choose more than one, it won't let me...

Any help?
I think this won't work if you have checked "Hide Extensions For Known Files Types", in Windows Explorer>Tools>Folder Options>View !

Other than that, no idea ! That should work !!
Quote Originally Posted by Hassan View Post
I think this won't work if you have checked "Hide Extensions For Known Files Types", in Windows Explorer>Tools>Folder Options>View !

Other than that, no idea ! That should work !!
It was checked, but I unchecked it, still doesn't work. Can you give it a try?
Quote Originally Posted by Cryptonic View Post
It was checked, but I unchecked it, still doesn't work. Can you give it a try?
Post some filenames that you're testing the program with (complete names) ! I'll tell you after seeing that !
Quote Originally Posted by Hassan View Post


Post some filenames that you're testing the program with (complete names) ! I'll tell you after seeing that !
Basically, I'm making a program that moves (copies) your files. So, i made 2 text document files, and tried to select them both by using Ctrl.

If you just HAVE to have the files names, here.

New Text Document.txt
New Text Document (2).txt

Besides, this is my code.

[php]Dim Open As New OpenFileDialog
Open.Title = "Files to be Moved"
Open.ShowDialog()
Open.SupportMultiDottedExtensions = True
Open.Filter = "All Files (*.*)|*.*"
TextBox1.Text = Open.FileName[/php]
Quote Originally Posted by Cryptonic View Post
Basically, I'm making a program that moves (copies) your files. So, i made 2 text document files, and tried to select them both by using Ctrl.

If you just HAVE to have the files names, here.

New Text Document.txt
New Text Document (2).txt

Besides, this is my code.

[php]Dim Open As New OpenFileDialog
Open.Title = "Files to be Moved"
Open.ShowDialog()
Open.SupportMultiDottedExtensions = True
Open.Filter = "All Files (*.*)|*.*"
TextBox1.Text = Open.FileName[/php]
correct ur code
Code:
Dim Open As New OpenFileDialog
Open.Tittle = "Files to be Moved"
Open.SupportMultiDottedExtensions = True
Open.Filter = "All Files (*.*)|*.*"
If Open.ShowDialog = Windows.Forms.DialogResult.OK Then
     TextBox1.Text = Open.FileName
End If
Quote Originally Posted by T0P-CENT View Post
correct ur code
Code:
Dim Open As New OpenFileDialog
Open.Tittle = "Files to be Moved"
Open.SupportMultiDottedExtensions = True
Open.Filter = "All Files (*.*)|*.*"
If Open.ShowDialog = Windows.Forms.DialogResult.OK Then
     TextBox1.Text = Open.FileName
End If
Thanks, but that still didn't solve the problem.

BTW, you spelled title wrong...
Quote Originally Posted by Cryptonic View Post
Thanks, but that still didn't solve the problem.

BTW, you spelled title wrong...
sorry i wrote it on memory
i'm gonna try to build one and test
Edit : I didn't get the whole idea but i think
you are tring to select two files with that dialog i guess so
i think it gives u error because u choosed one textbox
so i think
Textbox1.Text = Open.FileNames.ToString
Edit : It won't enable selecting to files unless u Set it to true
Open.MultiSelect = True
And I tried Filenames it didn't work but i think the error is from it when u select 2 files
You Can't Use Open.FileName
Quote Originally Posted by T0P-CENT View Post
sorry i wrote it on memory
i'm gonna try to build one and test
Edit : I didn't get the whole idea but i think
you are tring to select two files with that dialog i guess so
i think it gives u error because u choosed one textbox
so i think
Textbox1.Text = Open.FileNames.ToString
Edit : It won't enable selecting to files unless u Set it to true
Open.MultiSelect = True
And I tried Filenames it didn't work but i think the error is from it when u select 2 files
You Can't Use Open.FileName
Thanks, using MultiSelect worked.

I used Open.Filename, it worked fine...

BUT i have another error. When I select more than 1 file, the text shows when i click open...

System.String[]

a multidotted extension example

meh.txt.exe.psd.wtf.mehmehmeh.html
[highlight=php]For Each file In Open.FileNames
//Do something?
//TextBox1.Text += file & " "
Next[/highlight]
Quote Originally Posted by master131 View Post
[highlight=php]For Each file In Open.FileNames
//Do something?
//TextBox1.Text += file & " "
Next[/highlight]
Worked, now, to get the program to move all the files to 1 spot...
Quote Originally Posted by Cryptonic View Post
Worked, now, to get the program to move all the files to 1 spot...
Code:
Dim newDirectory As String = "C:\Test\Test\"
For each s As String in OpenFile.FileNames
    Dim fileLoc As String = s
    IO.File.Move(fileLoc, newDirectory & IO.Path.GetFileName(fileLoc))
Next
     
Quote Originally Posted by Jason View Post


Code:
Dim newDirectory As String = "C:\Test\Test\"
For each s As String in OpenFile.FileNames
    Dim fileLoc As String = s
    IO.File.Move(fileLoc, newDirectory & IO.Path.GetFileName(fileLoc))
Next
     
Ok, 1 Problem. It addes the folder name to the files that are to be moved and doesn't move the files...

Heres a pic if you don't know what i'm saying...

master131 has it, can't believe noone else saw it. If you're selecting multiple files in your OpenFileDialog, it will return a string array with each path that was selected. As master demonstrated above, you can loop through all the items in the array and do something with each file.
Posts 1–15 of 32 · Page 1 of 3
This thread is closed for replies.

Tags for this Thread

None

Need help?