View Files in Flash Drive

How can i write this coad ?

Page 1 of 1

3 Replies - 2029 Views - Last Post: 04 February 2009 - 11:12 PM Rate Topic: -----

#1 souksavanh  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 04-February 09

View Files in Flash Drive

Post icon  Posted 04 February 2009 - 06:48 PM

Now i want to write code of vb.net to connect with Flash drive and views all files in flash drive, Please help me
Thank you
Is This A Good Question/Topic? 0
  • +

Replies To: View Files in Flash Drive

#2 RaySlay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 04-February 09

Re: View Files in Flash Drive

Posted 04 February 2009 - 06:59 PM

Use the OpenFileDialog in the tool box.


What kind of files are you wanting to open ?

This post has been edited by RaySlay: 04 February 2009 - 06:59 PM

Was This Post Helpful? 0
  • +
  • -

#3 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 294
  • View blog
  • Posts: 1,533
  • Joined: 07-April 08

Re: View Files in Flash Drive

Posted 04 February 2009 - 07:12 PM

just like he said Do a google search for openfiledialog

otherwise

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#4 RodgerB  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 66
  • View blog
  • Posts: 2,284
  • Joined: 21-September 07

Re: View Files in Flash Drive

Posted 04 February 2009 - 11:12 PM

Something like this should help.

Dim drives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()

For Each drive As System.IO.DriveInfo In drives
	'Skip floppy's.. useless garage.
	' If the user is using a B:\ drive, they deserve to experience a 1 second lag
	' that I can't stand with the A:\
	If drive.Name <> "A:\" Then
		' Check if the drive is removable
		If drive.DriveType = IO.DriveType.Removable Then
			Dim directory As String = drive.Name
			Dim fileDialog As New OpenFileDialog()
			fileDialog.InitialDirectory = directory
			fileDialog.ShowDialog()
		End If
	End If
Next


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1