Code for finding manufacturer serial number for hard drive in C#

  • Thread starter Thread starter Tayyab
  • Start date Start date
T

Tayyab

Hi, If you understand the subject of my post that means you would know
why i want this. Please dont give me the code for Volume number as i
am talking about manufacturer serial number. I am working on C# and I
know about win32_PhysicalMedia to retrieve the manufacturer serial
number but that does not work for Win 2000 and I want something that
works for Win 2000. Even if there is no solution in C# but you have
something in C or J# that could help me that would be great too. Again
please dont refer me to DiskId32 to get serial number as I have
already spent alot of time trying to invoke it from C# , I tried
wrapping procedures, but that does not work. So please I really need
help and await a reasonable response from some genie out there.
 
Hi, If you understand the subject of my post that means you would know
why i want this. Please dont give me the code for Volume number as i
am talking about manufacturer serial number. I am working on C# and I
know about win32_PhysicalMedia to retrieve the manufacturer serial
number but that does not work for Win 2000 and I want something that
works for Win 2000. Even if there is no solution in C# but you have
something in C or J# that could help me that would be great too. Again
please dont refer me to DiskId32 to get serial number as I have
already spent alot of time trying to invoke it from C# , I tried
wrapping procedures, but that does not work. So please I really need
help and await a reasonable response from some genie out there.


hey u ppl sleeping or what give me some ideas i need them.
 
Tayyab wrote:

(snip)
hey u ppl sleeping or what give me some ideas i need them.

That is an unwise thing for you to say. People are under no obligation
to help you. You should not attempt to demand a reply.


Having said that ...
From what I remember of diskid32, the problem is not the programming
language: the problem is how to actually do it! In other words, there
is no piece of simple code that will do it reliably for all hard disks.

Could you talk to the developer of diskid32 & see if he would licence
the sourcecode?

Perhaps he'd do it if you produced a version in the language you want,
then released that version back to him, for him to add to his page.

HTH,
TC
 
Hi,

you can send an "IOCTL_SCSI_PASS_THROUGH_DIRECT" Command
with an ATA-RegisterFile or SRB setup for an "Identify Drive" Command.
The Output-Buffer of this IOCTL contains a 512-Byte-Sector with the
configuration Data.
I can provide you (if you want this) with some sample-code that has worked
for me.

regards

Reiner
 
Bob,

the Code I'm written is in "unmanaged" C++
(although more C than ++ *grin*)
and it's only pertinent to ATA-Disks!
Are you're still interested?

regards

Reiner
 
Back
Top