我怎样才能获得当前用户的&QUOT的路径,应用数据和QUOT;夹? [英] How can i get the path of the current user's "Application Data" folder?

查看:120
本文介绍了我怎样才能获得当前用户的&QUOT的路径,应用数据和QUOT;夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)我怎样才能找出Windows安装驱动器,其中用户工作?我需要这个导航到的ApplicationData 在DocumentsandSettings。

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)此外,我怎样才能在用户名太让我可以转到ApplicaitionData?例如:D:\\ Documents和Settings \\用户\\应用数据。

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

推荐答案

看着结合<一个href=\"http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx\">Environment.GetFolderPath和<一个href=\"http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx\">Environment.SpecialFolder要做到这一点。

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

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

这篇关于我怎样才能获得当前用户的&QUOT的路径,应用数据和QUOT;夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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