Accessing %appdata% with VB.NET
问题 How can you access files in %appdata% through VB.NET? For example, C:\Users\Kuzon\AppData\Roaming\program . How would I access that file, but on another Windows 7 machine? Also, how would you do it on Windows XP? I believe it is %Application Data% . 回答1: When you're writing .NET code, it's recommended that you use the functions explicitly designed for this purpose, rather than relying on environment variables such as %appdata% . You're looking for the Environment.GetFolderPath method, which