Jump to content











Photo
- - - - -

imdisk and VB.NET

vb visual basic .net

Best Answer _Michael , 19 May 2013 - 11:21 AM

The problem is meanwhile solved. It was a syntax error.

 

I´ve typed the source code in the topic manually and while this I "solved" the problem. The mistake was in line 6.

 

Conclusion: my posted source code is working! The mount Point have to be a drive letter with a following colon.

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 _Michael

_Michael
  • Members
  • 2 posts
  •  
    Germany

Posted 19 May 2013 - 12:19 AM

Hi,

 

I´m new to imdisk and I´m trying to create a virtual drive with VB.NET.

 

I tried something with the following code:

 

Imports LTR.IO.ImDisk.ImDiskAPI

Public Class Form1
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) ...
        Dim deviceID As UInt32 = UInt32.MaxValue
        CreateDevice(10485760, "L:", deviceID)
        CreateMountPoint("L:", deviceID)
    End Sub
End Class

 

The drive was created and Windows detected it and informs me that I have to format the drive. But if I want to do that an error occurs: "The drive can not be formatted. Make sure that the disk is properly inserted and is not write-protected and try it again."

I think that my code is not complete.

 

The drive letter L: is not used of course...

 

Or rather: I need a little tutorial how to create a virtual drive via VB.NET.

 

Thank you all for your suggestions! Please ask if you have questions.



#2 _Michael

_Michael
  • Members
  • 2 posts
  •  
    Germany

Posted 19 May 2013 - 11:21 AM   Best Answer

The problem is meanwhile solved. It was a syntax error.

 

I´ve typed the source code in the topic manually and while this I "solved" the problem. The mistake was in line 6.

 

Conclusion: my posted source code is working! The mount Point have to be a drive letter with a following colon.



#3 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1415 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 19 May 2013 - 01:01 PM

Good to hear that it works. Some general "hints" for using the .NET library: Syntax is explained in the library.

 

http://ltr-data.se/library/ImDiskNet/ (wIth some "modern" versions of IE this site need "compatibility mode")

 

The same information is also available directly as you type in the development environment if you put ImDisk.xml in the same directory as ImDisk.dll.

 

Happy coding!

:cheers:







Also tagged with one or more of these keywords: vb, visual basic, .net

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users