Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Serial de disco duro con C#

809 views
Skip to first unread message

hrodash

unread,
Jul 20, 2004, 6:44:18 PM7/20/04
to
Me gustaria que alguien me ayudara - quiesiera saber como
obtener el numero de serial del disco duro y/o tarjeta
madre utilizando C#. Gracias.
HRodas

Misael Monterroca

unread,
Jul 20, 2004, 7:16:18 PM7/20/04
to
Con WMI

Aqui tienes un ejemplo

http://www.codeguru.com/vb/controls/vb_shell/comments.php/c3049/?thread=39850

--
Saludos!
http://cacho.zapto.org/blog
estonova.mm...@msn.com

"hrodash" <anon...@discussions.microsoft.com> wrote in message
news:0e5f01c46eab$17bd9560$a501...@phx.gbl...

Franco Figún

unread,
Jul 20, 2004, 9:10:26 PM7/20/04
to
Este ejemplo funciona perfecto:

// Runs on Windows Me, W2K and XP.
// Need to install WMI core on NT4 and W98
using System;
using System.Management;
class App {
public static void Main() {

string[] cimClass = {"Win32_LogicalDisk", "Win32_Processor",

"Win32_OperatingSystem"};
foreach(string cc in cimClass)
{
Console.WriteLine("----------- {0} --------------", cc);
ManagementClass cimobject = new ManagementClass(cc);
ManagementObjectCollection moc = cimobject.GetInstances();
foreach(ManagementObject mo in moc)
foreach(PropertyData s in mo.Properties)
{
try {
Console.WriteLine(s.Name + ":\t\t" + mo[s.Name].ToString());
}
catch(System.NullReferenceException)
{
Console.WriteLine("No object reference for: " + s.Name);
continue;
}
}
}
}
}

--
FF
www.francofigun.com.ar
MSN: franc...@hotmail.com
Yahoo MSN: fran...@yahoo.com.ar

"hrodash" <anon...@discussions.microsoft.com> wrote in message
news:0e5f01c46eab$17bd9560$a501...@phx.gbl...

0 new messages