文件夹操作

来源:互联网 发布:淘宝扣分清零时间 编辑:程序博客网 时间:2024/05/14 01:13
string foldername = ".""";             if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)            {                foldername = folderBrowserDialog1.SelectedPath;            }            if (System.IO.Directory.Exists(foldername))            {                System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(foldername);                System.IO.FileInfo[] fi = di.GetFiles("*.wmf");                if (fi.Length != 0)                {                    foreach (FileInfo f in fi)                    {                        MessageBox.Show(f.ToString());                    }                }            }

0 0
原创粉丝点击