TizzyT

HDD serial

Sep 16th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Management;
  6. static class Module1
  7. {
  8.     public static void Main()
  9.     {
  10.         ManagementObjectSearcher hd =
  11.             new ManagementObjectSearcher("SELECT * FROM in32_PhysicalMedia");
  12.         foreach (ManagementObject dvs in hd.Get()) {
  13.             string serial = dvs["SerialNumber"].ToString();
  14.             Console.WriteLine(serial);
  15.         }
  16.         Console.ReadKey();
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment