我的图片的位置

时间:2020-03-06 14:33:03  来源:igfitidea点击:

如何以编程方式(使用C#)找出"我的图片"文件夹的路径是什么?

在XP和Vista上可以使用吗?

解决方案

Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);

以下内容将返回用户图片文件夹位置的完整路径(在XP上为Username \ My Documents \ My Pictures,在Vista上为Username \ Pictures)

Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);

使用Microsoft.VisualBasic.FileIO.SpecialDirectories.MyPictures可以在Vista和XP中运行。