获取当前系统桌面路径(C# 代码)

01.using System; 02.using System.Collections.Generic; 03.using System.ComponentModel; 04.using System.Data; 05.using System.Drawing; 06.using System.Text; 07.using System.Windows.Forms; 08. 09.namespace GetDeskDirectory 10.{ 11. public partial class Form1 : Form 12. { 13. public Form1() 14. { 15. InitializeComponent(); 16. } 17. 18. private void button1_Click(object sender, EventArgs e) 19. { 20. string dir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); 21. MessageBox.Show("桌面的路径是"+dir); 22. } 23. } 24.}
posted @ 2011-05-30 10:49  deepwishly  阅读(399)  评论(0编辑  收藏  举报