hard-drive

What is the easiest way in C# to check if hard disk is SSD without writing any file on hard disk?

蹲街弑〆低调 提交于 2019-11-29 12:20:55
问题 I need to check in C# if a hard disk is SSD (Solid-state drive), no seek penalty? I used: ManagementClass driveClass = new ManagementClass("Win32_DiskDrive"); ManagementObjectCollection drives = driveClass.GetInstances(); But its only gives Strings that contain SSD in the properties, I can't depend on that? I Need a direct way to check that? 回答1: WMI will not be able to determine this easily. There is a solution here that's based on the same algorithm Windows 7 uses to determine if a disk is

Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP

China☆狼群 提交于 2019-11-29 04:52:07
Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP : How can it be done? I want to store it in a file. OS : windows 2000,XP,ME,Vista... Yes, I want the serial number of the hard drive of the Server. Or can it be done through Adobe AIR? Or can it be done through a C program on Windows? C:\Documents and Settings\Administrator>dir Volume in drive C has no label. Volume Serial Number is BC16-5D5F Is this number : BC16-5d5f unique for a hard drive? How is it different from the manufacturer given serial number? wmic DISKDRIVE GET SerialNumber Displays only the following

Converting HDD Serial # VB6 code into VB.NET code

人盡茶涼 提交于 2019-11-29 02:34:36
I've got a cool piece of code taken from a VC++ project which gets complete information of the hard disk drive WITHOUT using WMI (since WMI has got its own problems) I ask those of you who are comfortable with API functions to try to convert this VB6 code into VB (or C#) .NET and help A LOT of people who are in great need of this utility class. I've spent lots of time and searched the entire net to find ways to get the actual model and serial number of HDD and eventually found this one, if only it were in .NET... Here is the code and sorry about its formatting problems, just paste it into VB6

Serial number of Hard Disk or Hard Drive

僤鯓⒐⒋嵵緔 提交于 2019-11-28 20:54:30
At first it may seems it is very easy question and some body may be trying to give me advice to try Google, it may be so. But for me it is very hard I have try Google, Stack Overflow and can’t find any good solution. Just want to get Serial number of Hard Disk or Hard Drive using C# Please read carefully: serial number of Hard Disk, but not Serial number of Volume of Hard Disk (e.g. C, D, E, etc). For getting serial no of volume of hard disk I have found solution on net and its work well but problem is with Getting serial number of Hard Disk. Some body may trying to make this question as

How do I get the disk drive serial number in C/C++

南笙酒味 提交于 2019-11-28 08:38:09
This has been already answered but it's a C# solution. How do I do this in C or C++? There are a few ways to do this. You could make calls using system to get the information. For Linux: system("hdparm -i /dev/hda | grep -i serial"); Without using system: static struct hd_driveid hd; int fd; if ((fd = open("/dev/hda", O_RDONLY | O_NONBLOCK)) < 0) { printf("ERROR opening /dev/hda\n"); exit(1); } if (!ioctl(fd, HDIO_GET_IDENTITY, &hd)) { printf("%.20s\n", hd.serial_no); } else if (errno == -ENOMSG) { printf("No serial number available\n"); } else { perror("ERROR: HDIO_GET_IDENTITY"); exit(1); }

Reading Data from a Physical Hard Drive

你说的曾经没有我的故事 提交于 2019-11-28 06:55:09
问题 I am trying to develop a program that goes and finds 2 connected unformatted physical drives and read bytes. The program currently runs in the administrator mode since that's the only way I guess the program can see unformatted hard drives. I am using visual studio 2015 and it runs in windows 7 machine. The problem is that it can only read multiples of 512 (512 is the sector size). Currently the unformatted hard drives are located in disk 2 and 3 slots (they are both SSDs). It first reads 512

Getting a list of logical drives

…衆ロ難τιáo~ 提交于 2019-11-27 21:48:35
How can I get the list of logial drives (C#) on a system as well as their capacity and free space? System.IO.DriveInfo.GetDrives() Chris Ballance foreach (var drive in DriveInfo.GetDrives()) { double freeSpace = drive.TotalFreeSpace; double totalSpace = drive.TotalSize; double percentFree = (freeSpace / totalSpace) * 100; float num = (float)percentFree; Console.WriteLine("Drive:{0} With {1} % free", drive.Name, num); Console.WriteLine("Space Remaining:{0}", drive.AvailableFreeSpace); Console.WriteLine("Percent Free Space:{0}", percentFree); Console.WriteLine("Space used:{0}", drive.TotalSize);

Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP

北慕城南 提交于 2019-11-27 18:55:48
问题 Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP : How can it be done? I want to store it in a file. OS : windows 2000,XP,ME,Vista... Yes, I want the serial number of the hard drive of the Server. Or can it be done through Adobe AIR? Or can it be done through a C program on Windows? C:\Documents and Settings\Administrator>dir Volume in drive C has no label. Volume Serial Number is BC16-5D5F Is this number : BC16-5d5f unique for a hard drive? How is it different

Know how fast a Hard Drive is in Delphi

泄露秘密 提交于 2019-11-27 15:16:55
问题 I am writing a diagnosis program (like everest, but simpler) and I need to know how fast a HardDrive is. I wanna know things such as: 1 - Bytes per second (read) 2 - Bytes per second (write) 3 - S.M.A.R.T data I guess I can use WMI to query such thing, but i have no idea how. It does not matter if I need to buy a component or get a opensource one. I also know that Windows Perfmoon is able to do that, but I cannot use it. 回答1: Rafael to obtain the S.M.A.R.T data you can use the WMI or the

Python causing: IOError: [Errno 28] No space left on device: '../results/32766.html' on disk with lots of space

房东的猫 提交于 2019-11-27 13:56:37
I am running a Python script that is causing the above error. The unusual thing is this script is running on a different machine and is having no problems. The difference is that on the machine that is causing the problems I am writing to an external hard drive. To make things even weirder this script has run on the problem machine and already written over 30,000 files. Some relevant information (The code that is causing the error): nPage = 0 while nPage != -1: for d in data: if len(d.contents) > 1: if '<script' in str(d.contents): l = str(d.contents[1]) start = l.find('http://') end = l.find(