How to get serial number of my drive ?
Answer / Dharmendra Singh Shishodia
To get the serial number of a drive in Delphi, you can use the GetVolumeInformation function from the Windows API. Here's an example:nn```delphinfunction GetDriveSerialNumber: string;nbeginn tryn declaren pVolInfo : TWin32_Volume_DISK_DRIVE_INFO;n lBufferSize : DWORD;n lReturnLength : DWORD;n constn dwBufSize : DWORD = SizeOf(pVolInfo);n n if GetVolumeInformation(@a, nil, 0, pVolInfo, dwBufSize, lBufferSize, lReturnLength, nil) thenn Result := PChar(pVolInfo.VolumeSerialNumber);n elsen RaiseLastOSError;n exceptn on E: Exception don Result := E.Message;n end;nend;
| Is This Answer Correct ? | 0 Yes | 0 No |
How to install BDE network ?
Is it possible to connect to InterBase from a Delphi app without using the BDE?
How to Use global values in our application ?
How to Get the windows directory?
When I try to execute sql query from delphi7 it throws the following exception ORA-01704: string literal too long. I know the reason why its throwing this exception. My problem is.... I have catched this exception throw Try.... Except block.....In except block i am performing rollback..... due to above error its also throwing exception in rollback transaction...........due to rollback exception...........it had created some problem in connection...........every time when i try to open or close a connection it throws an exception " Operation is not allowed when the object is open"
How to Change the port of a printer?
How to Initialize an array or record to null?
How to get the date of the last day in the current month?
How to Pass a function to a procedure or vice versa?
How to Select a cell in a DBGrid ?
How to plot a line?
How to assign a Null value to a numeric field in a table?