Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Visual Basic

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-20-2008, 07:09 PM
Per Juul Larsen
 
Posts: n/a
Check for removable disk an images ! how

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
Reply With Quote
  #2  
Old 07-22-2008, 03:47 AM
myford100@yahoo.com
 
Posts: n/a
Re: Check for removable disk an images ! how

On Sun, 20 Jul 2008 20:09:13 +0200, Per Juul Larsen <juul@larsen.dk>
wrote:

>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


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.

Reply With Quote
  #3  
Old 07-22-2008, 10:29 AM
Per Juul Larsen
 
Posts: n/a
Re: Check for removable disk an images ! how

myford100@yahoo.com skrev:
> On Sun, 20 Jul 2008 20:09:13 +0200, Per Juul Larsen <juul@larsen.dk>
> wrote:
>
>> 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

>
> 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.
>

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
Reply With Quote
  #4  
Old 07-27-2008, 07:29 PM
Raoul Watson
 
Posts: n/a
Re: Check for removable disk an images ! how


"Per Juul Larsen" <juul@larsen.dk> wrote in message
news:26609$48837f50$57486c0a$18986@news.comxnet.dk ...
> 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


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


Reply With Quote
  #5  
Old 07-27-2008, 07:51 PM
Per Juul Larsen
 
Posts: n/a
Re: Check for removable disk an images ! how

Raoul Watson skrev:
> "Per Juul Larsen" <juul@larsen.dk> wrote in message
> news:26609$48837f50$57486c0a$18986@news.comxnet.dk ...
>> 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

>
> 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
>
>


Thank you
A very good solution which I now use it.
best regards
pjl
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Programming > Visual Basic


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:57 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Mobile Phones | Gas Suppliers | Per Insurance | Loans | Car Loan