Click here to Skip to main content
15,891,375 members
Articles / Programming Languages / C#
Article

Bienz.SysInfo - System Information the .NET way

Rate me:
Please Sign up or sign in to vote.
4.63/5 (7 votes)
15 Jun 20021 min read 70.1K   1.4K   30   6
A library that assists in gathering system information such as disk volumes, labels and even disk icons.
Sample Image Bienz.SysInfo

Preface

I have noticed other articles where users are attempting to gain access to system information available only via old Win32 APIs. Although it is easy enough to obtain this information, I have noticed it occurring rather frequently.

This library was developed to group some of these APIs and make them more accessible in the .NET way - the way I feel Microsoft should have included them in the first place.

As of the writing of this article, the only class in the library deals with storage APIs. I plan to eventually expand this library to deal with many other system APIs. Currently, Bienz.SysInfo provides access to the following information:

  • Volume Type (Removable, Fixed, Remote / Network, CD-ROM, RAMDisk, etc.)
  • Volume Label
  • Volume Serial Number
  • UNC Network Path (even if constructed from mapped drive letter)
  • Large Icon as presented by the Shell (32x32)
  • Small Icon as presented by the Shell (16x16)
  • Supporting Properties (such as SupportsCompression and SupportsEncryption)

The VolumeInfo Class

Public Static (Shared) Properties

  • CurrentVolume

Public Instance Properties

  • CaseSensitive
  • Compressed
  • Flags
  • Label
  • LargeIcon
  • MaxComponentLen
  • PersistentACLS
  • PreservesCase
  • ReadOnly
  • SerialNumber
  • SmallIcon
  • SupportsEncryption
  • SupportsFileCompression
  • SupportsNamedStreams
  • SupportsObjectIDs
  • SupportsQuotas
  • SupportsReparsePoints
  • SupportsSparseFiles
  • SupportsUnicodeOnVolume
  • UncPath
  • Uri
  • VolumeType

VolumeFlags enumeration

  • Unknown
  • CaseSensitive
  • Compressed
  • PersistentACLS
  • PreservesCase
  • ReadOnly
  • SupportsEncryption
  • SupportsFileCompression
  • SupportsNamedStreams
  • SupportsObjectIDs
  • SupportsQuotas
  • SupportsReparsePoints
  • SupportsSparseFiles
  • SupportsUnicodeOnVolume

VolumeTypes enumeration

  • Unknown
  • Invalid
  • Removable
  • Fixed
  • Remote
  • CDROM
  • RAMDisk

For an example use of this library, please check out my Bienz.UI library. Bienz.UI includes a drive drop-down control that displays all drives in the system as well as their labels and icons. The SelectedItem property of this control returns an instance of the VolumeInformation class from Bienz.SysInfo.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I live in Houston Texas and coding is my hobby. I am happily employed with a well-known computer software company.

My web address is: http://www.bienz.com and my e-mail is jared@bienz.com.

Comments and Discussions

 
GeneralThanks Pin
marasinghe24-Nov-07 6:35
marasinghe24-Nov-07 6:35 
QuestionSysInfo Pin
Jawz-X2-Jun-06 11:48
Jawz-X2-Jun-06 11:48 
Generalload icons in win32 Pin
huutri7931-Oct-04 22:44
huutri7931-Oct-04 22:44 
QuestionThe source Code ? Pin
hugoballermann25-Sep-03 23:02
hugoballermann25-Sep-03 23:02 
AnswerRe: The source Code ? Pin
Jared Bienz26-Sep-03 9:19
Jared Bienz26-Sep-03 9:19 
Generalthanks a lot Pin
Anonymous11-Nov-02 20:13
Anonymous11-Nov-02 20:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.