⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2454.html

📁 VB技巧问答10000例 VB技巧问答10000例
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">

<title>GetVolumeInformation</title>

<style type="text/css">

    body     { font-size: 80%; font-family: Verdana, Arial, Helvetica; }

    table    { font-size: 90%; font-family: Verdana, Arial, Helvetica; }

    h1       { font-weight: bold; font-size: 145%; }

    h2       { font-weight: bold; font-size: 125%; }

    h3       { font-weight: bold; font-size: 110%; }

    h4       { font-weight: bold; font-size: 100%; margin-top: 10pt; }

    h5       { font-weight: bold; font-size: 90%;  margin-top: 10pt; }

    big      { font-weight: bold; }

    code     { font-family: Lucida Sans Typewriter, Courier New, Courier; }

    pre      { font-family: Lucida Sans Typewriter, Courier New, Courier; font-size: 125%; }

    dt       { margin-top: 10pt; }

    li       { margin-top: 10pt; }

    img      { vertical-align: middle; }

    .indent1 { margin-left: 12pt; }

    .indent2 { margin-left: 24pt; }

    .indent3 { margin-left: 36pt; }

</style>

</HEAD>

<BODY BGCOLOR=#FFFFFF TEXT=#000000>

<font face="Verdana,Arial,Helvetica">

<h2>GetVolumeInformation</h2>

<p>

The <b>GetVolumeInformation</b> function returns information about a file system and volume whose root directory is specified. </p>

<pre><code><b>BOOL GetVolumeInformation(

  LPCTSTR</b><i> lpRootPathName</i><b>,        </b>// address of root directory of the 

                                 // file system

<b>  LPTSTR</b><i> lpVolumeNameBuffer</i><b>,     </b>// address of name of the volume

<b>  DWORD</b><i> nVolumeNameSize</i><b>,         </b>// length of <i>lpVolumeNameBuffer</i>

<b>  LPDWORD</b><i> lpVolumeSerialNumber</i><b>,  </b>// address of volume serial number

<b>  LPDWORD</b><i> lpMaximumComponentLength</i><b>,</b>

<b>                                 </b>// address of system's maximum 

                                 // filename length

<b>  LPDWORD</b><i> lpFileSystemFlags</i><b>,     </b>// address of file system flags

<b>  LPTSTR</b><i> lpFileSystemNameBuffer</i><b>, </b>// address of name of file system

<b>  DWORD</b><i> nFileSystemNameSize</i>      // length of <i>lpFileSystemNameBuffer</i>

<b>);</b>

 </code></pre>

<h5>Parameters</h5>

<dl>

<dt>

<i>lpRootPathName</i></dt>

<dd>

Points to a string that contains the root directory of the volume to be described. If this parameter is NULL, the root of the current directory is used. If this parameter is a UNC name, you must follow it with an additional backslash. For example, you would specify \\MyServer\MyShare as \\MyServer\MyShare\.</dd>

<dt>

<i>lpVolumeNameBuffer</i></dt>

<dd>

Points to a buffer that receives the name of the specified volume. </dd>

<dt>

<i>nVolumeNameSize</i></dt>

<dd>

Specifies the length, in characters, of the volume name buffer. This parameter is ignored if the volume name buffer is not supplied. </dd>

<dt>

<i>lpVolumeSerialNumber</i></dt>

<dd>

Points to a variable that receives the volume serial number. This parameter can be NULL if the serial number is not required. </dd>

<dt>

<i>lpMaximumComponentLength</i></dt>

<dd>

Points to a doubleword value that receives the maximum length, in characters, of a filename component supported by the specified file system. A filename component is that portion of a filename between backslashes. 

<p>

The value stored in variable pointed to by <b>*</b><i>lpMaximumComponentLength</i> is used to indicate that long names are supported by the specified file system. For example, for a FAT file system supporting long names, the function stores the value 255, rather than the previous 8.3 indicator. Long names can also be supported on systems that use the NTFS file system.

</dd>

<dt>

<i>lpFileSystemFlags</i></dt>

<dd>

Points to a doubleword that receives flags associated with the specified file system. This parameter can be any combination of the following flags, however, FS_FILE_COMPRESSION and FS_VOL_IS_COMPRESSED are mutually exclusive. 

<table cellspacing=5 cols=2>

<tr valign=top>

<th align=left width=232>Value</th>

<th align=left width=233>Meaning</th>

</tr>

<tr valign=top>

<td width=232>FS_CASE_IS_PRESERVED</td>

<td width=233>The file system preserves the case of filenames when it places a name on disk.</td>

</tr>

<tr valign=top>

<td width=232>FS_CASE_SENSITIVE</td>

<td width=233>The file system supports case-sensitive filenames.</td>

</tr>

<tr valign=top>

<td width=232>FS_UNICODE_STORED_ON_DISK</td>

<td width=233>The file system supports Unicode in filenames as they appear on disk.</td>

</tr>

<tr valign=top>

<td width=232>FS_PERSISTENT_ACLS</td>

<td width=233>The file system preserves and enforces ACLs. For example, NTFS preserves and enforces ACLs, and FAT does not. </td>

</tr>

<tr valign=top>

<td width=232>FS_FILE_COMPRESSION</td>

<td width=233>The file system supports file-based compression.</td>

</tr>

<tr valign=top>

<td width=232>FS_VOL_IS_COMPRESSED</td>

<td width=233>The specified volume is a compressed volume; for example, a DoubleSpace volume.</td>

</tr>

<tr valign=top>

<td width=232>FILE_SUPPORTS_ENCRYPTION</td>

<td width=233>The file system supports the Encrypted File System (EFS).</td>

</tr>

<tr valign=top>

<td width=232>FILE_SUPPORTS_OBJECT_IDS</td>

<td width=233>The file system supports object identifiers.</td>

</tr>

<tr valign=top>

<td width=232>FILE_SUPPORTS_REPARSE_POINTS</td>

<td width=233>The file system supports reparse points.</td>

</tr>

<tr valign=top>

<td width=232>FILE_SUPPORTS_SPARSE_FILES</td>

<td width=233>The file system supports sparse files.</td>

</tr>

<tr valign=top>

<td width=232>FILE_VOLUME_QUOTAS</td>

<td width=233>The file system supports disk quotas.</td>

</tr>

</table>

</dd>

</dl>

<dl>

<dt>

<i>lpFileSystemNameBuffer</i></dt>

<dd>

Points to a buffer that receives the name of the file system (such as FAT or NTFS). </dd>

<dt>

<i>nFileSystemNameSize</i></dt>

<dd>

Specifies the length, in characters, of the file system name buffer. This parameter is ignored if the file system name buffer is not supplied. </dd>

</dl>

<h5>Return Values</h5>

<p>

If all the requested information is retrieved, the return value is nonzero.</p>

<p>

If not all the requested information is retrieved, the return value is zero. To get extended error information, call <b>GetLastError</b>. </p>

<h5>Remarks</h5>

<p>

If you are attempting to obtain information about a floppy drive that does not have a floppy disk or a CD-ROM drive that does not have a compact disc, the system displays a message box asking the user to insert a floppy disk or a compact disc, respectively. To prevent the system from displaying this message box, call the <b>SetErrorMode</b> function with SEM_FAILCRITICALERRORS.</p>

<p>

The FS_VOL_IS_COMPRESSED flag is the only indicator of volume-based compression. The file system name is not altered to indicate compression. This flag comes back set on a DoubleSpace volume, for example. With volume-based compression, an entire volume is either compressed or not compressed.</p>

<p>

The FS_FILE_COMPRESSION flag indicates whether a file system supports file-based compression. With file-based compression, individual files can be compressed or not compressed.</p>

<p>

The FS_FILE_COMPRESSION and FS_VOL_IS_COMPRESSED flags are mutually exclusive; both bits cannot come back set.</p>

<p>

The maximum component length value, stored in the <b>DWORD</b> variable pointed to by <i>lpMaximumComponentLength</i>, is the only indicator that a volume supports longer-than-normal FAT (or other file system) file names. The file system name is not altered to indicate support for long file names.</p>

<p>

The <b>GetCompressedFileSize</b> function obtains the compressed size of a file. The <b>GetFileAttributes</b> function can determine whether an individual file is compressed.</p>

</body>

</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -