Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding

Status
Not open for further replies.

job357

Technical User
Sep 16, 2002
106
US
Greetings everyone, can someone put me in the right direction of binding a network filesystem eg. \\foo\share\docs to a combobox, so that when selected the contents of "docs" will be listed?

Thanks!

 
Just get a list of files in the folder, then add the list to the combo

Imports system.io
Code:
 Public Function zGetFilesinDirectory(ByVal sDir As String, _
        Optional ByVal sExtension As String = "") As FileInfo()

dim f as fileinfo()
If Not Directory.Exists(sDir) Then Return Nothing
Dim d As New DirectoryInfo(sDir)
f = d.GetFiles("*." + sExtension)
Return f

End Function

'Add to the Combo
dim f as fileinfo()=zGetFilesinDirectory("c:\temp\")
For i As Integer = 0 To f.Length - 1
    Dim s As String = f(0).Name()
    Combo.items.add(s)
Next


Sweep
...if it works dont f*** with it
curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top