如何获取当前用户的“应用程序数据"的路径?文件夹? [英] How can i get the path of the current user's "Application Data" folder?

查看:14
本文介绍了如何获取当前用户的“应用程序数据"的路径?文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1) 我怎样才能找到用户正在工作的 Windows 安装驱动器?我需要它来导航到 DocumentsandSettings 中的 ApplicationData.

1)how can i find out the Windows Installation drive in which the user is working.? I need this to navigate to the ApplicationData in DocumentsandSettings.

2)另外,我怎样才能获得用户名,以便我可以转到应用程序数据.?例如:D:Documents and SettingsuserApplication Data".

2)Also how can i get the user name too so that i can goto ApplicaitionData.? Eg: "D:Documents and SettingsuserApplication Data".

推荐答案

看结合 Environment.GetFolderPath环境.专用文件夹来做到这一点.

Look at combining Environment.GetFolderPath and Environment.SpecialFolder to do this.

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

这篇关于如何获取当前用户的“应用程序数据"的路径?文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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