Microsoft Visual C++ MFC. Win95 WinNT


TestFile - 4


//

//=====================================================

void CMFStartApp::FileSystemInfo()

{

 

//

CString VolumeNameBuffer;

 

//

DWORD nVolumeNameSize = 100;

 

//

DWORD VolumeSerialNumber;

 

//

DWORD MaximumComponentLength;

 

//

DWORD FileSystemFlags;

 

//

CString FileSystemNameBuffer;

 

//

DWORD nFileSystemNameSize = 100;

 

//

GetVolumeInformation(

NULL,

VolumeNameBuffer.GetBuffer(nVolumeNameSize),

nVolumeNameSize,

&VolumeSerialNumber,

&MaximumComponentLength, &FileSystemFlags,

FileSystemNameBuffer.GetBuffer(nFileSystemNameSize),

nFileSystemNameSize );

 

//

VolumeNameBuffer.ReleaseBuffer();

FileSystemNameBuffer.ReleaseBuffer();

 

// ,

//

try

{

// fsystem.dat

CStdioFile file("fsystem.dat",

CFile::modeCreate |

CFile::modeWrite |

CFile::typeText);

 

// ,

CString strTmpOut;

 

// 512

strTmpOut.GetBuffer(512);

 

//

strTmpOut.Format(" : %s \n", VolumeNameBuffer);

file.WriteString(strTmpOut);