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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excluding network drives from OpenFileDialog

Status
Not open for further replies.

woogoo

Programmer
Feb 14, 2004
247
0
0
GB
Hi All,

Is there a way to exclude Network drives from an OpenFileDialog box or prevent their selection, or do I have to do it the hardway?
--

woogoo
 
something like this will do it.
Code:
        Dim flddlg As New FolderBrowserDialog
        flddlg.RootFolder = Environment.SpecialFolder.MyDocuments
        flddlg.ShowDialog()

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Thanks but I'm using an OpenFileDialog and this method isn't supported. So I ended up with:
Code:
' User has selected a file so get the file's drive info.
Dim m_Info As DriveInfo = My.Computer.FileSystem.GetDriveInfo(m_FD.FileName.Substring(0, 1))
' Check to see if the drive is local
If (m_Info.DriveType = DriveType.Fixed) Then
    ...
End If

I would rather have the drives filtered, so the user doesn't get frustrated, so I'll mayby roll my own later if needed.


woogoo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top