访问用户的特殊文件夹 [英] Access to a user's Special Folders

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

问题描述

如何访问其他用户的特殊文件夹位置?


配置文件存储在用户的appData文件夹和
$ b中$ b程序改变它将在管理员下运行。

How can I get access for another user''s special folder locations?

A configuration file is stored in the users'' appData folder and the
program altering it will be ran under the admin.

推荐答案



你可以使用LogonUser来模仿其他用户然后

SHGetFolderPath来获取相应的路径,但是只需获取当前用户的特殊文件夹位置就可以轻松获得
然后使用

字符串操作来获取其他用户的文件夹。


HTH,


Sam

------------------------------------------- -----------------

我们正在招聘! B-Line Medical正在寻求Mid / Sr. .NET

开发人员在医疗产品中获得令人兴奋的职位

开发MD / DC。在轻松的团队环境中使用各种技术

。在Dice.com上查看广告。

2006年8月21日12:01:58 -0700, wh * ******@gmail.com 写道:

You could use LogonUser to impersonate the other user and then
SHGetFolderPath to get the appropriate path, but it''d be much easier
to just get the current user''s special folder location and then use
string manipulation to get the other user''s folder.

HTH,

Sam
------------------------------------------------------------
We''re hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On 21 Aug 2006 12:01:58 -0700, wh*******@gmail.com wrote:

>如何访问其他用户的特殊文件夹位置?<配置文件存储在用户的appData文件夹中,改变它的程序将在admin下运行。
>How can I get access for another user''s special folder locations?

A configuration file is stored in the users'' appData folder and the
program altering it will be ran under the admin.


但它会更容易
but it''d be much easier

来获取当前用户'的特殊文件夹位置然后使用

字符串操作来获取其他用户的文件夹。
to just get the current user''s special folder location and then use
string manipulation to get the other user''s folder.



这个问题是用户可以将他们的特殊文件夹设置为

,无论他们想要什么;即。将我的文件设置为c:\ Docs而不是

正常路径。


我想我可能会尝试模拟选项。

The problem with this is that the user can set their special folder to
whatever they want; ie. set my documents to c:\Docs instead of the
normal path.

I guess I might try the impersonate option.




您可以尝试的另一件事是直接阅读注册表。

目录存储在这里:

HKEY_USERS \ xxxx \ Software /\\ Microsoft \ Windows \ Current Version \ Exploratorr \ Shell < br $>
文件夹


诀窍是你需要遍历所有用户并根据登录用户找到合适的

一个名称和QUOT;存储在这里(包括

域名):


HKEY_USERS \ xxxx \软件\ Microsoft \ Windows \当前版本\探险家


比冒充更多的工作,但不需要知道密码。


HTH,


Sam


------------------------------------ ------------------------

我们正在招聘! B-Line Medical正在寻求Mid / Sr. .NET

开发人员在医疗产品中获得令人兴奋的职位

开发MD / DC。在轻松的团队环境中使用各种技术

。在Dice.com上查看广告。


2006年8月21日12:25:32 -0700, wh ******* @ gmail.com 写道:

Another thing you can try is reading the registry directly. The
directories are stored here:

HKEY_USERS\xxxx\Software\Microsoft\Windows\Current Version\Explorer\Shell
Folders

The trick is you need to loop through all the users and find the right
one based on "Logon User Name" stored here (which will include
domain):

HKEY_USERS\xxxx\Software\Microsoft\Windows\Current Version\Explorer

More work than impersonation, but doesn''t require knowing passwords.

HTH,

Sam

------------------------------------------------------------
We''re hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

On 21 Aug 2006 12:25:32 -0700, wh*******@gmail.com wrote:

>但它'' d更容易获取当前用户的特殊文件夹位置,然后使用
字符串操作来获取其他用户的文件夹。
>but it''d be much easier
to just get the current user''s special folder location and then use
string manipulation to get the other user''s folder.


这个问题是用户可以将他们的特殊文件夹设置为
他们想要的东西;即。将我的文档设置为c:\Docs而不是
正常路径。

我想我可能会尝试使用模拟选项。


The problem with this is that the user can set their special folder to
whatever they want; ie. set my documents to c:\Docs instead of the
normal path.

I guess I might try the impersonate option.


这篇关于访问用户的特殊文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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