Windows标准文件位置 [英] Windows Standard File Locations

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

问题描述

有人可以指出一个文件,其中列出了Windows中的所有标准文件位置,应该使用哪些标准文件位置,不应该使用它们。像

 用户应用程序数据 - > %USERDIR%/ AppData / Local /%VENDOR%/%APPLICATION%

等等。

解决方案

免责声明


执行 not ever 使用
硬路径到这些位置。
只使用提供的API(无论
这些API是标准的Win32 API,
.NET API,无论如何)访问它们。
否则,您可能会遇到Windows $的不同版本和语言
的风险。



这是一个真正的风险 - 他们已经
更改了这些位置至少四
次 - 这只是我可以从
回忆我的头顶!不要
提到漫游配置文件和其他有趣的
可怕的怪异。


现在,大的免责声明是不对的,列表在哪里? 维基百科有它。用一粒盐做一些首次出现;我有90%的确定我已经看到其中的一些出现在声称之前。我无耻地剪切和重新格式化了他们的内容:




  • 应用程序数据


    • 每用户应用程序特定的文件

    • %USERPROFILE%\应用程序数据

    • 首次出现在Windows 98


  • Cookie


    • Internet Explorer浏览器Cookie

    • %USERPROFILE%\Cookies

    • 首次出现在Windows 98中





    • 存储在用户桌面上的文件

    • %USERPROFILE%\Desktop

    • 首次出现在Windows 95中


  • 收藏夹


    • 用户收藏

    • %USERPROFILE%\Favorites

    • 首次出现在Windows 98中


  • F onts


    • 已安装字体的容器文件夹

    • %windir%\字体

    • 首次出现在Windows XP中


  • 历史


    • 用户特定的浏览器历史记录

    • %USERPROFILE%\本地设置\历史

    • 首次出现在Windows 98中


  • Internet缓存


    • 用户特定的Internet临时文件

    • %USERPROFILE%\Local Settings\Temporary Internet Files

    • 首先出现在Windows 98中


  • 本地应用程序数据


    • 特定于用户和计算机的应用程序设置

    • %USERPROFILE%\Local Settings\Application Data

    • 首次出现在Windows 2000 / ME


  • 我的文档


    • 用户文档

    • %USERPROFILE%\我的文件(WinNT行)

    • C:\My Documents(Win98-ME) li>
    • 首次出现在Windows 98中


  • 我的音乐


    • 用户音乐

    • %USERPROFILE%\My Documents\My Music

    • 首次出现在Windows XP中


  • 我的图片


    • 用户图片

    • %USERPROFILE%\My Documents\My Pictures

    • 首次出现在Windows XP中


  • 我的视频


    • 用户视频文件

    • %USERPROFILE%\My Documents\My视频

    • 首次出现在Windows XP中


  • 节目


    • 用户特定的(全部)程序组和图标

    • %USERPROFILE%\Start Menu\Programs

    • 首次出现在Windows 95中


  • 最近


    • 用户特定的我最近的文档

    • %USERPROFILE%\Recent

    • 98


  • 发送到


    • 用户特定的发送到菜单项

    • %USERPROFILE%\SendTo

    • 首次出现在Windows 98中


  • 开始菜单


    • 用户特定的开始菜单项目

    • %USERPROFILE%\开始菜单

    • 首次出现在Windows 98中


  • 系统


    • Windows系统目录

    • %windir%\系统32

    • 首次曝光d在Windows 2000中


  • 已保存的游戏


    • 用户保存的游戏

    • %USERPROFILE%\saved游戏

    • 出现在Windows Vista中


  • 模板


    • 用户特定的文档模板

    • %USERPROFILE%\Templates

    • 出现在Windows 98中



Could somebody point me to a document which lists all the standard file locations in windows and what one should and shouldn't use them for. Something like

User Application Data -> %USERDIR%/AppData/Local/%VENDOR%/%APPLICATION%

and so forth.

解决方案

Big Disclaimer

Do not ever use the hard paths to these locations. Only use the provided APIs (whether those APIs be standard Win32 APIs, the .NET APIs, whatever) to access them. Otherwise you run the risk of breaking on different versions and languages of Windows.

And that's a real risk -- they've changed those locations at least four times -- and that's just in what I can recall off the top of my head! Not to mention roaming profiles and other fun weirdness that can crop up.

Now that the big disclaimer is out of the way, where's the list? Wikipedia has it. Take some of the "first-appeared-in" with a grain of salt; I'm 90% sure I've seen some of these appear earlier than is claimed. I have shamelessly cut-and-pasted-and-reformatted their content below:

  • Application Data
    • Per-user application-specific files
    • %USERPROFILE%\Application Data
    • First appeared in Windows 98
  • Cookies
    • Internet Explorer browser cookies
    • %USERPROFILE%\Cookies
    • First appeared in Windows 98
  • Desktop Directory
    • Files stored on the user's desktop
    • %USERPROFILE%\Desktop
    • First appeared in Windows 95
  • Favorites
    • User's Favorites
    • %USERPROFILE%\Favorites
    • First appeared in Windows 98
  • Fonts
    • Container folder for installed fonts
    • %windir%\Fonts
    • First appeared in Windows XP
  • History
    • User-specific browser history
    • %USERPROFILE%\Local Settings\History
    • First appeared in Windows 98
  • Internet Cache
    • User-specific Temporary Internet Files
    • %USERPROFILE%\Local Settings\Temporary Internet Files
    • First appeared in Windows 98
  • Local Application Data
    • User-specific and computer-specific application settings
    • %USERPROFILE%\Local Settings\Application Data
    • First appeared in Windows 2000/ME
  • My Documents
    • User's documents
    • %USERPROFILE%\My Documents (WinNT line)
    • C:\My Documents (Win98-ME)
    • First appeared in Windows 98
  • My Music
    • User's music
    • %USERPROFILE%\My Documents\My Music
    • First appeared in Windows XP
  • My Pictures
    • User's pictures
    • %USERPROFILE%\My Documents\My Pictures
    • First appeared in Windows XP
  • My Videos
    • User's video files
    • %USERPROFILE%\My Documents\My Videos
    • First appeared in Windows XP
  • Programs
    • User-specific "(All) Programs" groups and icons
    • %USERPROFILE%\Start Menu\Programs
    • First appeared in Windows 95
  • Recent
    • User-specific "My Recent Documents"
    • %USERPROFILE%\Recent
    • 98
  • Send To
    • User-specific "Send To" menu items
    • %USERPROFILE%\SendTo
    • First appeared in Windows 98
  • Start Menu
    • User-specific "Start Menu" items
    • %USERPROFILE%\Start Menu
    • First appeared in Windows 98
  • System
    • The Windows system directory
    • %windir%\system32
    • First appeared in Windows 2000
  • Saved Games
    • User's Saved Games
    • %USERPROFILE%\saved games
    • First appeared in Windows Vista
  • Templates
    • User-specific document templates
    • %USERPROFILE%\Templates
    • First appeared in Windows 98

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

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