仅提供中文版本
Title : 获得电脑特殊文件夹的办法
官方连接:Environment.SpecialFolder
我们通常会在文件中加载一些缓存文件,方便下次运行的时候调取。如果使用硬盘地址如:H:\preview ,用户可能会出现没有H盘符的情况,但是所有的电脑都会有一些固定的缓存路径.
如果想要访问Temp文件夹,在电脑中我们可以输入%temp%命令快速进入,在程序中我们通过Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)调取,参数为枚举值,可以参照官方链接获得具体的地址。

Author: Broccoli
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2020-05-25
How to Compare Version Numbers in C#

2020-05-27
C# Software Auto-update via Database
2020-08-26
Get Enum Value and DescriptionAttribute from String
2020-01-19
Issue where modifying List A also modifies List B

2020-12-03
C# String and Hex Conversion

2021-10-13
C# Writing Data to Word via Template