Skip to content

Instantly share code, notes, and snippets.

View slurrps-mcgee's full-sized avatar
:octocat:
More practice with bootstrap 5

Kenneth Lamb slurrps-mcgee

:octocat:
More practice with bootstrap 5
View GitHub Profile
@MiloszKrajewski
MiloszKrajewski / GetDrives.cs
Created March 29, 2016 08:29
Get drive information (C#, Windows, WMI)
var driveQuery = new ManagementObjectSearcher("select * from Win32_DiskDrive");
foreach (ManagementObject d in driveQuery.Get())
{
var deviceId = d.Properties["DeviceId"].Value;
//Console.WriteLine("Device");
//Console.WriteLine(d);
var partitionQueryText = string.Format("associators of {{{0}}} where AssocClass = Win32_DiskDriveToDiskPartition", d.Path.RelativePath);
var partitionQuery = new ManagementObjectSearcher(partitionQueryText);
foreach (ManagementObject p in partitionQuery.Get())
{
@aaronjwood
aaronjwood / BinarySearchTree.cs
Created February 15, 2016 05:57
Binary search tree implementation in C#
using System;
using System.Diagnostics;
namespace BinarySearchTree
{
class Node
{
public int value;
public Node left;
public Node right;