Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DukeW · Sep 14, 2011 at 12:22 PM · securityhardware

Detecting CD-ROM drives

Im trying to integrate our current security algorithms in Unity, this would require me to detect all the cd drives on the users computer. I Found two ways to do it in C#: Using ManagementObjectSearcher to query WMI, or using System.IO.DriveInfo.GetDrives(), but I get "NotImplementedException: The requested feature is not implemented." when using either.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image msknapp · Sep 14, 2011 at 01:55 PM 0
Share

Cannot you try:

for (int i = (int)'a';i<(int)'z';i++) {
FileInfo f = new FileInfo(Char.ToUpper((char)i)+":\\");
if (f.Exists)
Debug.Log("File "+f.ToString()+" exists, insert code here.");
}

Also, make sure it is not in web player mode. If it is, then none of the file functions will work or compile. I noticed that if you build a web player version of your game, then running it in the editor is also considered web player mode. If you build again for pc standalone, then the editor is in pc standalone mode. I consider that a bug in Unity, there is no other way to change the mode that the editor is running with.

avatar image syclamoth · Sep 14, 2011 at 01:57 PM 0
Share

This method only works on windows- searching for device drivers would be more cross-platform (and after all, Unity is all about the cross-plateform). I only ever get those non-implemented exceptions when I try to modify my scripts at runtime- I'm not really sure what causes them.

avatar image DukeW · Sep 14, 2011 at 02:13 PM 0
Share

@syclamoth NotImplementedExceptions are used when you declare a method but you do not implement it(it doesn't actually do anything). To make sure people know it doesn't do anything you throw a not implemented exception.

@msknapp Thanks for the suggestion but that would help me only to find every drive, without being able to decide if it is a CD-RO$$anonymous$$. Please note that the solution I am looking for only needs to work for Windows stand alone player.

Thanks

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by DukeW · Sep 26, 2011 at 02:40 PM

Hey, just an update, I found a solution to my problem.(Again i mention that I was only looking for a solution for Windows stand alone player). I called the following command: wmic /OUTPUT:%TEMP%\\cdRomInfo.txt PATH Win32_CDROMDrive GET /VALUE /FORMAT:csv, this outputs a csv formatted txt file in the current users temp folder wich contains a bunch of info about the CD-Rom drives. (it can also give lots of technical info about other hardware components like processor, RAM etc)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ChiuanWei · Feb 09, 2012 at 06:46 AM 0
Share

Can u make clear????help....

avatar image DukeW · Feb 09, 2012 at 09:27 AM 0
Share

@chiuan Ill try. I created a new batch file(.bat) containing the command "wmic /OUTPUT:%TE$$anonymous$$P%\cdRomInfo.txt PATH Win32_CDRO$$anonymous$$Drive GET /VALUE /FOR$$anonymous$$AT:csv" witch basically creates a csv formatted file in the current users temp directory called cdRomInfo.txt, that contains info on all CD RO$$anonymous$$ drives Windows is aware of.I parsed the file to find the drives I was interested in using some code i found by simply googleing parsing CSV C#. And yes this can also be applied for other devices, because I am guessing that's what interests you.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

xCode to Unity communication? 1 Answer

Can Unity3D run without hardware acceleration? 1 Answer

Baking with Beast, XEON v. i7 ? 0 Answers

access to hardware information for licensing an app. 0 Answers

Publishing Question - Is it possible to make the data folder and assets not modifiable by the game user? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges