Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create a DataSet with two tables having a 'JOIN' in ADO.NET? Pin
Pete O'Hanlon13-Oct-10 0:59
mvePete O'Hanlon13-Oct-10 0:59 
QuestionRe: How to create a DataSet with two tables having a 'JOIN' in ADO.NET? Pin
PravinSingh13-Oct-10 7:20
PravinSingh13-Oct-10 7:20 
AnswerRe: How to create a DataSet with two tables having a 'JOIN' in ADO.NET? Pin
fjdiewornncalwe12-Oct-10 2:48
professionalfjdiewornncalwe12-Oct-10 2:48 
AnswerRe: How to create a DataSet with two tables having a 'JOIN' in ADO.NET? Pin
PIEBALDconsult12-Oct-10 3:34
mvePIEBALDconsult12-Oct-10 3:34 
AnswerRe: How to create a DataSet with two tables having a 'JOIN' in ADO.NET? Pin
T M Gray12-Oct-10 8:16
T M Gray12-Oct-10 8:16 
GeneralRe: How to create a DataSet with two tables having a 'JOIN' in ADO.NET? Pin
PIEBALDconsult12-Oct-10 17:15
mvePIEBALDconsult12-Oct-10 17:15 
Questionhow to findout which drive is a cool disk? Pin
Fred 3412-Oct-10 1:40
Fred 3412-Oct-10 1:40 
AnswerRe: how to findout which drive is a cool disk? Pin
Luc Pattyn12-Oct-10 1:52
sitebuilderLuc Pattyn12-Oct-10 1:52 
Hi,

I know three ways to get some information on physical devices:

1.
using the DriveInfo class

2.
using WMI, have a look at the WMI classes Win32_DiskDrive, Win32_LogicalDiskToPartition, Win32_PhysicalMedia, Win32_CDROMDrive; which ones you want depends on the information you need.
warning: not everything may be available to regular users under Vista/Win7 without going trough the UAC dialog.

3.
using Win32 functions (from kernel32.dll), which requires P/Invoke. Here is an example prototype:
/// <summary>
/// Gets the drive type
/// </summary>
/// <param name="rootPathName">drive name (letter colon backslash)</param>
/// <returns>
/// 0 (DRIVE_UNKNOWN) The drive type cannot be determined.
/// 1 (DRIVE_NO_ROOT_DIR) The root path is invalid. (no volume is mounted at the path).
/// 2 (DRIVE_REMOVABLE) The disk can be removed from the drive.
/// 3 (DRIVE_FIXED) The disk cannot be removed from the drive.
/// 4 (DRIVE_REMOTE) The drive is a remote (network) drive.
/// 5 (DRIVE_CDROM) The drive is a CD-ROM drive.
/// 6 (DRIVE_RAMDISK) The drive is a RAM disk.
/// </returns>
[DllImport("kernel32.dll")]
public static extern int GetDriveType(string rootPathName);


For each of these, I refer to the MSDN documentation, Google, and some experimentation.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


QuestionBlock Desktop to prevent user interaction Pin
teknolog12311-Oct-10 23:03
teknolog12311-Oct-10 23:03 
AnswerRe: Block Desktop to prevent user interaction Pin
Luc Pattyn11-Oct-10 23:41
sitebuilderLuc Pattyn11-Oct-10 23:41 
GeneralRe: Block Desktop to prevent user interaction Pin
teknolog12312-Oct-10 0:37
teknolog12312-Oct-10 0:37 
GeneralRe: Block Desktop to prevent user interaction Pin
Luc Pattyn12-Oct-10 0:53
sitebuilderLuc Pattyn12-Oct-10 0:53 
GeneralRe: Block Desktop to prevent user interaction Pin
fjdiewornncalwe12-Oct-10 2:53
professionalfjdiewornncalwe12-Oct-10 2:53 
GeneralRe: Block Desktop to prevent user interaction Pin
teknolog12312-Oct-10 11:08
teknolog12312-Oct-10 11:08 
QuestionDataBindingComplete Pin
Dewald11-Oct-10 22:54
Dewald11-Oct-10 22:54 
AnswerRe: DataBindingComplete - modified Pin
OriginalGriff11-Oct-10 23:06
mveOriginalGriff11-Oct-10 23:06 
GeneralRe: DataBindingComplete - modified Pin
Dewald11-Oct-10 23:18
Dewald11-Oct-10 23:18 
QuestionInvoke methods in OCX in run time in c# Pin
Viratsaran11-Oct-10 20:16
Viratsaran11-Oct-10 20:16 
AnswerRe: Invoke methods in OCX in c# Pin
Abhinav S11-Oct-10 20:24
Abhinav S11-Oct-10 20:24 
AnswerRe: Invoke methods in OCX in c# Pin
JF201511-Oct-10 21:22
JF201511-Oct-10 21:22 
QuestionListView GetItemAt: problem with point returned Pin
DaveGriffith11-Oct-10 13:27
DaveGriffith11-Oct-10 13:27 
AnswerRe: ListView GetItemAt: problem with point returned Pin
Luc Pattyn11-Oct-10 14:05
sitebuilderLuc Pattyn11-Oct-10 14:05 
GeneralRe: ListView GetItemAt: problem with point returned Pin
DaveGriffith11-Oct-10 14:24
DaveGriffith11-Oct-10 14:24 
AnswerRe: ListView GetItemAt: problem with point returned Pin
Luc Pattyn11-Oct-10 14:38
sitebuilderLuc Pattyn11-Oct-10 14:38 
AnswerRe: ListView GetItemAt: problem with point returned Pin
DaveGriffith11-Oct-10 15:04
DaveGriffith11-Oct-10 15:04 

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.