Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / July 2008



Tip: Looking for answers? Try searching our database.

Check for removable disk an images ! how

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Per Juul Larsen - 20 Jul 2008 19:09 GMT
Hi
my VB program must always start from a removable disk. In addition, on
the removable media to be images of the type *. jpg *. tips.
If not the two conditions are present, the programme will end with a
message.

How do I write this little control function in Visual Basic

regards pjl
myford100@yahoo.com - 22 Jul 2008 03:46 GMT
>Hi
>my VB program must always start from a removable disk. In addition, on
[quoted text clipped - 5 lines]
>
>regards pjl

Is there a requirement that this be done in Visual Basic?  Go to
http://irfanview.com/ and look at the first item in the FAQ.  

It is possible this is not what you are wanting to do.  If not,
perhaps someone else can help.
Per Juul Larsen - 22 Jul 2008 10:29 GMT
myford100@yahoo.com skrev:

>> Hi
>> my VB program must always start from a removable disk. In addition, on
[quoted text clipped - 12 lines]
> perhaps someone else can help.
>  
irfanview is free and a super program, though I want to make a small vb
program instead, which do not have to fill much.
Perhaps it can be done as a Dos Batch program instead.
Thank you for your reply
mvh pjl
Raoul Watson - 27 Jul 2008 19:29 GMT
> Hi
> my VB program must always start from a removable disk. In addition, on the
[quoted text clipped - 5 lines]
>
> regards pjl

When you start the program, simply check the current app.path drive
type. If it is not removable, terminate.

Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" _
(ByVal nDrive As String) As Long
Const DRIVE_REMOVABLE = 2
Const DRIVE_REMOTE = 4
Const DRIVE_RAMDISK = 6
Const DRIVE_FIXED = 3
Const DRIVE_CDROM = 5

'syntax: MyDriveType("a:") or MyDriveType(dir1.path) etc..,

Function MyDriveType(ByVal DR As String) As String
DR = Left$(DR, 2)
x% = GetDriveType(DR)
Select Case x%
   Case DRIVE_REMOVABLE
       MyDriveType = "REMOVABLE    " & DR
   Case DRIVE_FIXED
       MyDriveType = "FIXED        " & DR
   Case DRIVE_REMOTE
       MyDriveType = "REMOTE       " & DR
   Case DRIVE_RAMDISK
       MyDriveType = "RAMDISK      " & DR
   Case DRIVE_CDROM
       MyDriveType = "CDROM        " & DR
   Case Else
       MyDriveType = "UNKNOWN      " & DR
End Select
End Function
Per Juul Larsen - 27 Jul 2008 19:51 GMT
Raoul Watson skrev:
>> Hi
>> my VB program must always start from a removable disk. In addition, on the
[quoted text clipped - 37 lines]
> End Select
> End Function

   
Thank you
A very good solution which I now use it.
best regards
pjl
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.