Sunday, December 25, 2011

How to Make a Visual Basic Application for Password Protected Thumb Drives


1. Click the Windows 'Start' button and select 'All Programs.' Click 'Microsoft Visual Basic.' Click 'Visual Basic' to open the Visual Basic studio.
2. Double-click the window you want to use for the login entries. Drag and drop a text box control from the toolbox on the left side of the window and place the text box in the window form. Drag two text boxes to the window. One is for a login user name and the other is for the password.
3. Drag and drop a button control from the toolbox to the window form. This is the button users will press to log in to the drive. Double-click the button to open the button's code, which is where you type the Visual Basic code to log in.
4. Type the code to access the flash drive. Type the following code into your window:Set fso = CreateObject('Scripting.FileSystemObject')dive.VolumeName = 'x'Set reg=GetObject('winmgmts:{impersonationLevel=impersonate}!\\username\password\root\default:StdRegProv')