Z
Z
Zakharov Alexander2016-06-08 08:23:41
Programming
Zakharov Alexander, 2016-06-08 08:23:41

Need to get information about a disk partition by file name?

Hello.
The general question is this - you need a windows log analyzer to audit file names in C#. In the log, the format for outputting messages about file operations looks like this:
ee6e0d1a13a44afdb8e29a7c549bc2f3.png
Question: It is
required to get the file name in the format \Device\HarddiskVolumeNN (NN - section number)\path\to\file.ext by the full file name. The definition of the disk as "\Device\HarddiskVolume" is also quite satisfactory, and then I will replace the letter with replace.
PS
I found that it "seems" this can be done through WMI, but it seems to me that this is a long operation, at the same time the logging system itself does this without noticeable delays.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2016-06-08
@AlexZaharow

GetVolumeNameForVolume
QueryDosDevice
Also about you:
stackoverflow.com/questions/26573933/hard-disk-vol...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question