实现效果:
知识运用:
Environment类的GetFolderPath方法 //获取指向由枚举标识的系统特殊文件夹的路径
public static string GetFolderPath (Environment.SpecialFolder folder)
实现代码:
private void Form1_Load(object sender, EventArgs e) { foreach (Environment.SpecialFolder item in System.Enum.GetValues(typeof(Environment.SpecialFolder))) { ListViewItem it = new ListViewItem(item.ToString()); it.SubItems.Add(Environment.GetFolderPath(item)); listView1.Items.Add(it); } }
原文地址:https://www.cnblogs.com/feiyucha/p/10298038.html
时间: 2024-11-06 09:44:34