|
-
Dec 5th, 2008, 11:28 AM
#1
Thread Starter
New Member
[RESOLVED] [2005] Putting folde contents names into a text box?r
hey, im writing a program that has a button which opens up a folder browser dialog, then the user chooses a folder and the names of the files in that folder are put into a text box, i dont need the file extension to be printed there, just the file names and extensions.
does anyone have any idea on how i will be able to do this?
thanks in advanced
-
Dec 5th, 2008, 11:32 AM
#2
Re: [2005] Putting folde contents names into a text box?r
You don't need the file extension, just the file names and extensions? That doesn't make much sense to me.
My usual boring signature: Nothing
 
-
Dec 5th, 2008, 01:15 PM
#3
-
Dec 5th, 2008, 01:23 PM
#4
Thread Starter
New Member
Re: [2005] Putting folde contents names into a text box?r
sorry lol i ment i didnt need file paths lol just file names and extensions
-
Dec 5th, 2008, 01:42 PM
#5
Thread Starter
New Member
Re: [2005] Putting folde contents names into a text box?r
and ty for the code, but VS seems to have a problem with it when i click the addfile button the program crashes and;
"di As New IO.DirectoryInfo(dlgBrowse.SelectedPath)"
is highlighted with the exception;
"path is not of a legal form"
any ideas on that?
thanks all help is appreciated
-
Dec 5th, 2008, 01:48 PM
#6
Hyperactive Member
-
Dec 5th, 2008, 03:31 PM
#7
Thread Starter
New Member
Re: [2005] Putting folde contents names into a text box?r
vb Code:
Imports System.IO Public Class frmBrowser Private Sub btnSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelect.Click Dim di As New IO.DirectoryInfo(dlgBrowse.SelectedPath) Dim aryFi As IO.FileInfo() = di.GetFiles("*.*") Dim fi As IO.FileInfo For Each fi In aryFi If txtFolders.Multiline = True Then txtFolders.Text = txtFolders.Text & vbCrLf & fi.Name.Replace(fi.Extension, "") Else txtFolders.Text = txtFolders.Text & " | " & fi.Name.Replace(fi.Extension, "") End If Next End Sub End Class
thats wot i got completely lol
-
Dec 5th, 2008, 08:26 PM
#8
Thread Starter
New Member
Re: [2005] Putting folde contents names into a text box?r
i think i found the problem
-
Dec 5th, 2008, 08:28 PM
#9
Thread Starter
New Member
Re: [2005] Putting folde contents names into a text box?r
i managed to solve it lol im a dumbass i hadnt launched the dialog so what was the selected path supposed to be, no wonder the error lol, thanks for all the help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|