Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   CD-ROm detecting (http://www.programmingforums.org/showthread.php?t=10289)

NightShade01 Jun 11th, 2006 8:51 PM

CD-ROm detecting
 
Hey everyone i'm trying to write a program that contains many smaller things, such as batch files, text documents and other little programs. I want to be able to however have the program figure out what the CD rom drive is on the computer that the program is installed on....b/c obv it changes from comp to comp. Like if i instaled the prorgam on my computer and i have the E: drive as my cd-rom i need the program to auto detect that and then copy things from E: to the hard drive. i'm not sure how to go about doing this though. Any ideas??

DaWei Jun 11th, 2006 9:08 PM

This might be absolutely worthless to you, but I use winioctl in C/C++. You may find that VB has access to those things.

Booooze Jun 11th, 2006 11:41 PM

This shoudl help a bit:

:

           
            string[] drives;//String array
            drives = Directory.GetLogicalDrives();
            //Display first 2 drives
            MessageBox.Show(drives[0].ToString());
            MessageBox.Show(drives[1].ToString());

            //Determines whether specified Drive Exists
            DriveInfo di = new DriveInfo("D:");
            MessageBox.Show(di.DriveType.ToString());


It's C#, but the framework is the same. All you should need are some small modifications such as the array (will be defined differently in vb.net) and maybe the messagebox function. Other than that, it should at least put you one the right track.


All times are GMT -5. The time now is 8:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC