文件的文件系统GUID [英] File system GUID for a file

查看:121
本文介绍了文件的文件系统GUID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨:


我需要获取文件的唯一GUID,所以我通过

System.InteropServices使用API​​调用


我用的是

BY_HANDLE_FILE_INFORMATION





dwVolumeSerialNumber


获取特定文件的唯一FileSystem GUID。这是

适当的财产吗?我为每个运行它的文件获取了唯一的数字

for,所以它看起来是正确的,但我不确定。


文档说它是文件卷的唯一序列,

但是我想要文件本身的唯一序列。


谢谢!

Hi:

I need to get the unique GUID for a file, so I am using API calls through
System.InteropServices

I am using
BY_HANDLE_FILE_INFORMATION

and

dwVolumeSerialNumber

to get the unique FileSystem GUID for a particular file. Is this the
appropriate property? I am getting unique numbers for each file I run it
for, so it looks like the right one, but I am not sure.

The documentation says it is the unique serial for the volume of the file,
but I want the unique serial for the file itself.

Thanks!

推荐答案

没有文件或文件系统的GUID这样的东西。

你正在谈论的API(我想,因为你没有提到它,是

GetFileInformationByHandle返回一个指向

BY_HANDLE_FILE_INFORMATION结构的指针。

我想是唯一数字 ;你得到的是内存中结构的指针值

,它与GUID无关。你究竟在想什么?
最高成就?

威利。

Tarren <无*********** @ thankyou.com>在消息中写道

新闻:eE ************** @ TK2MSFTNGP03.phx.gbl ...

|嗨:

|

|我需要获取文件的唯一GUID,所以我通过

|使用API​​调用System.InteropServices

|

|我正在使用

| BY_HANDLE_FILE_INFORMATION

|

|和

|

| dwVolumeSerialNumber

|

|获取特定文件的唯一FileSystem GUID。这是

|适当的财产?我为每个运行它的文件获取唯一的数字

|因为,它看起来是正确的,但我不确定。

|

|文档说它是文件卷的唯一序列,

|但我想要文件本身的独特序列。

|

|谢谢!

|

|
There is no such thing like a GUID for a file or a file system.
The API your are talking about (I guess, because you did not mention it), is
GetFileInformationByHandle which returns a pointer to a
BY_HANDLE_FILE_INFORMATION structure.
I guess the "unique number" you get, is the pointer value to the structure
in memory, which has nothing to do with a GUID. What exactly are you trying
top achieve?
Willy.
"Tarren" <no***********@thankyou.com> wrote in message
news:eE**************@TK2MSFTNGP03.phx.gbl...
| Hi:
|
| I need to get the unique GUID for a file, so I am using API calls through
| System.InteropServices
|
| I am using
| BY_HANDLE_FILE_INFORMATION
|
| and
|
| dwVolumeSerialNumber
|
| to get the unique FileSystem GUID for a particular file. Is this the
| appropriate property? I am getting unique numbers for each file I run it
| for, so it looks like the right one, but I am not sure.
|
| The documentation says it is the unique serial for the volume of the file,
| but I want the unique serial for the file itself.
|
| Thanks!
|
|


感谢您的回复,Willy。


我想要实现的是将目录

中的一系列文件索引到数据库中。我需要每个字段的唯一标识符。我不能使用

文件名和路径,因为我不想丢失对文件的引用,即使文件名发生变化,也不会丢失


当我使用GetFileInformationByHandle函数和引用

dwVolumeSerialNumber时,它给出了我的数字,并且每个文件的数量相同

即使重新运行程序也是如此。这不是合适的标识符吗?


有什么想法吗?


感谢您的帮助。非常感谢。

Willy Denoyette [MVP]" <无线************* @ telenet.be>在留言中写道

新闻:ew ************** @ TK2MSFTNGP05.phx.gbl ...
Thanks for the response, Willy.

What I am trying to achieve is to index a series of files in a directory
into a database. I need a unique identifier for each field. I cannot use
filename and path, because I do not want to lose my reference to the file,
even if the file name changes.

When I use GetFileInformationByHandle function and reference
dwVolumeSerialNumber it gives me the number, and is the same number per file
even if rerun the program. This would not be the appropriate identifier?

Any thoughts?

Thanks for your help on this. Much appreciated.
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:ew**************@TK2MSFTNGP05.phx.gbl...
没有这样的东西就像文件或文件系统的GUID一样。
你正在谈论的API(我猜,因为你没有提到它),
是GetFileInformationByHandle,它返回一个指针
BY_HANDLE_FILE_INFORMATION结构。
我想是唯一号码。你得到的,是内存中结构的指针值,它与GUID无关。你到底想要什么?最佳实现?

Willy。

" Tarren" <无*********** @ thankyou.com>在消息中写道
新闻:eE ************** @ TK2MSFTNGP03.phx.gbl ...
|嗨:
|
|我需要获取文件的唯一GUID,因此我使用API​​调用
通过
| System.InteropServices
|
|我正在使用
| BY_HANDLE_FILE_INFORMATION
|
|和
|
| dwVolumeSerialNumber
|
|获取特定文件的唯一FileSystem GUID。这是
|适当的财产?我为每个运行的文件获取了唯一的数字

|因为它看起来像是正确的,但我不确定。
|
|文档说它是
文件卷的唯一序列,
|但我想要文件本身的唯一序列。
|
|谢谢!
|
|
There is no such thing like a GUID for a file or a file system.
The API your are talking about (I guess, because you did not mention it),
is
GetFileInformationByHandle which returns a pointer to a
BY_HANDLE_FILE_INFORMATION structure.
I guess the "unique number" you get, is the pointer value to the structure
in memory, which has nothing to do with a GUID. What exactly are you
trying
top achieve?
Willy.
"Tarren" <no***********@thankyou.com> wrote in message
news:eE**************@TK2MSFTNGP03.phx.gbl...
| Hi:
|
| I need to get the unique GUID for a file, so I am using API calls
through
| System.InteropServices
|
| I am using
| BY_HANDLE_FILE_INFORMATION
|
| and
|
| dwVolumeSerialNumber
|
| to get the unique FileSystem GUID for a particular file. Is this the
| appropriate property? I am getting unique numbers for each file I run
it
| for, so it looks like the right one, but I am not sure.
|
| The documentation says it is the unique serial for the volume of the
file,
| but I want the unique serial for the file itself.
|
| Thanks!
|
|



您好,


查看这个主题:

http://groups.google.com/group/micro ... f72cef1b0849a2

干杯,

-

Ignacio Machin,

ignacio。 machin AT dot.state.fl.us

佛罗里达州交通局

Tarren <无*********** @ thankyou.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP04.phx.gbl ...
Hi,

Check this thread:

http://groups.google.com/group/micro...f72cef1b0849a2
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Tarren" <no***********@thankyou.com> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
谢谢你响应,Willy。

我想要实现的是将目录中的一系列文件索引到数据库中。我需要每个字段的唯一标识符。我不能使用
文件名和路径,因为我不想丢失对文件的引用,即使文件名改变了。

当我使用GetFileInformationByHandle函数和引用时
dwVolumeSerialNumber它给我数字,即使重新运行程序,每个
文件的数字也是相同的。这不是合适的
标识符吗?

有什么想法吗?

感谢您的帮助。非常感谢。

Willy Denoyette [MVP]" <无线************* @ telenet.be>在消息中写道
新闻:ew ************** @ TK2MSFTNGP05.phx.gbl ...
Thanks for the response, Willy.

What I am trying to achieve is to index a series of files in a directory
into a database. I need a unique identifier for each field. I cannot use
filename and path, because I do not want to lose my reference to the file,
even if the file name changes.

When I use GetFileInformationByHandle function and reference
dwVolumeSerialNumber it gives me the number, and is the same number per
file even if rerun the program. This would not be the appropriate
identifier?

Any thoughts?

Thanks for your help on this. Much appreciated.
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:ew**************@TK2MSFTNGP05.phx.gbl...
没有像GUID这样的东西一个文件或一个文件系统。
你正在谈论的API(我猜,因为你没有提到它),
是GetFileInformationByHandle,它返回一个指向
BY_HANDLE_FILE_INFORMATION的指针结构。
我想唯一的数字。你得到的,是内存中指针值的
结构,它与GUID无关。你到底想要什么?最佳实现?

Willy。

" Tarren" <无*********** @ thankyou.com>在消息中写道
新闻:eE ************** @ TK2MSFTNGP03.phx.gbl ...
|嗨:
|
|我需要获取文件的唯一GUID,因此我使用API​​调用
通过
| System.InteropServices
|
|我正在使用
| BY_HANDLE_FILE_INFORMATION
|
|和
|
| dwVolumeSerialNumber
|
|获取特定文件的唯一FileSystem GUID。这是
|适当的财产?我为每个运行的文件获取了唯一的数字

|因为它看起来像是正确的,但我不确定。
|
|文档说它是
文件卷的唯一序列,
|但我想要文件本身的唯一序列。
|
|谢谢!
|
|
There is no such thing like a GUID for a file or a file system.
The API your are talking about (I guess, because you did not mention it),
is
GetFileInformationByHandle which returns a pointer to a
BY_HANDLE_FILE_INFORMATION structure.
I guess the "unique number" you get, is the pointer value to the
structure
in memory, which has nothing to do with a GUID. What exactly are you
trying
top achieve?
Willy.
"Tarren" <no***********@thankyou.com> wrote in message
news:eE**************@TK2MSFTNGP03.phx.gbl...
| Hi:
|
| I need to get the unique GUID for a file, so I am using API calls
through
| System.InteropServices
|
| I am using
| BY_HANDLE_FILE_INFORMATION
|
| and
|
| dwVolumeSerialNumber
|
| to get the unique FileSystem GUID for a particular file. Is this the
| appropriate property? I am getting unique numbers for each file I run
it
| for, so it looks like the right one, but I am not sure.
|
| The documentation says it is the unique serial for the volume of the
file,
| but I want the unique serial for the file itself.
|
| Thanks!
|
|




这篇关于文件的文件系统GUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆