C# Класс TrueLib.SystemDevices

Static wrapper for windows system devices.
Показать файл Открыть проект

Открытые методы

Метод Описание
GetDiskDriveBySignature ( String caption, uint signature ) : System.Management.ManagementObject

Gets a device with given caption and signature.

GetDiskSignatureFromLetter ( String letter, string &caption, uint &signature, uint &partitionNr ) : void

Gets the disk caption, signature and partition number by the drive letter.

GetDriveLetterBySignature ( String caption, uint signature, uint partitionNr ) : String

Gets the drive letter of a logical disk identified by its caption, signature and partition number.

GetLocalDiskPartitions ( ) : List

For debugging: returns identity information about all attached disks.

GetLogicalDisk ( String letter, int drive_type = 3 ) : System.Management.ManagementObject

Gets a logical disk by a drive letter an disk type.

GetPartitionByIndex ( uint DiskIndex, uint Index ) : System.Management.ManagementObject

Gets a partition by its disk index and partition index.

GetPartitionBySignature ( String caption, uint signature, uint partitionNr ) : System.Management.ManagementObject

Gets a partition with a given drive signature and partition index.

GetTCCompatibleDiskPath ( uint index ) : string

Returns a TC compatible path to an encrypted hard disk.

GetTCCompatibleName ( String deviceid ) : String

Converts the device id into a TrueCrypt compatible path.

IsDiskOnline ( string caption, uint signature ) : bool

Checks if a given disk is online.

IsLogicalDiskOnline ( String letter, int type = 2 ) : bool

Checks if logical device is online (=plugged in and mounted with drive letter).

IsPartitionOnline ( string caption, uint signature, uint partitionIndex ) : bool

Checks if a given disk drive partition is online.

IsRemovablePartition ( string deviceId ) : bool

Checks if a partition with given DeviceID is removable.

Приватные методы

Метод Описание
ReplaceEvaluator ( Match m ) : string

Contains logic to build a TC compatible device path.

Описание методов

GetDiskDriveBySignature() публичный статический Метод

Gets a device with given caption and signature.
public static GetDiskDriveBySignature ( String caption, uint signature ) : System.Management.ManagementObject
caption String Caption (title, name) of the device.
signature uint Signature (10 digit unsigned integer) of the device. May be 0 in some cases.
Результат System.Management.ManagementObject

GetDiskSignatureFromLetter() публичный статический Метод

Gets the disk caption, signature and partition number by the drive letter.
public static GetDiskSignatureFromLetter ( String letter, string &caption, uint &signature, uint &partitionNr ) : void
letter String Drive letter of the logical disk.
caption string Caption of the disk.
signature uint Signature of the disk.
partitionNr uint Partition number (zero based).
Результат void

GetDriveLetterBySignature() публичный статический Метод

Gets the drive letter of a logical disk identified by its caption, signature and partition number.
public static GetDriveLetterBySignature ( String caption, uint signature, uint partitionNr ) : String
caption String Caption (title, name) of the disk.
signature uint Signature (10 digit unsigned integer) of the disk.
partitionNr uint Partition number (zero based).
Результат String

GetLocalDiskPartitions() публичный статический Метод

For debugging: returns identity information about all attached disks.
public static GetLocalDiskPartitions ( ) : List
Результат List

GetLogicalDisk() публичный статический Метод

Gets a logical disk by a drive letter an disk type.
public static GetLogicalDisk ( String letter, int drive_type = 3 ) : System.Management.ManagementObject
letter String Drive letter of the disk.
drive_type int Optional drive type (3 = local, 2 = removable).
Результат System.Management.ManagementObject

GetPartitionByIndex() публичный статический Метод

Gets a partition by its disk index and partition index.
public static GetPartitionByIndex ( uint DiskIndex, uint Index ) : System.Management.ManagementObject
DiskIndex uint Disk index (zero based).
Index uint Partition index (zero based).
Результат System.Management.ManagementObject

GetPartitionBySignature() публичный статический Метод

Gets a partition with a given drive signature and partition index.
public static GetPartitionBySignature ( String caption, uint signature, uint partitionNr ) : System.Management.ManagementObject
caption String The disk drive caption.
signature uint The disk drive signature.
partitionNr uint The zero-based partition number.
Результат System.Management.ManagementObject

GetTCCompatibleDiskPath() публичный статический Метод

Returns a TC compatible path to an encrypted hard disk.
public static GetTCCompatibleDiskPath ( uint index ) : string
index uint
Результат string

GetTCCompatibleName() публичный статический Метод

Converts the device id into a TrueCrypt compatible path.
public static GetTCCompatibleName ( String deviceid ) : String
deviceid String Device ID
Результат String

IsDiskOnline() публичный статический Метод

Checks if a given disk is online.
public static IsDiskOnline ( string caption, uint signature ) : bool
caption string The caption of the disk drive.
signature uint The signature of the disk drive.
Результат bool

IsLogicalDiskOnline() публичный статический Метод

Checks if logical device is online (=plugged in and mounted with drive letter).
public static IsLogicalDiskOnline ( String letter, int type = 2 ) : bool
letter String Drive letter of the device.
type int
Результат bool

IsPartitionOnline() публичный статический Метод

Checks if a given disk drive partition is online.
public static IsPartitionOnline ( string caption, uint signature, uint partitionIndex ) : bool
caption string The caption of the disk drive.
signature uint The signature of the disk drive.
partitionIndex uint The zero-based partition index.
Результат bool

IsRemovablePartition() публичный статический Метод

Checks if a partition with given DeviceID is removable.
public static IsRemovablePartition ( string deviceId ) : bool
deviceId string The disk partition DeviceID.
Результат bool