标签:
OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = System.Environment.CurrentDirectory;//设定默认打开路径 if (ofd.ShowDialog() == DialogResult.OK) { string filePathName = ofd.FileName; string fileName = Path.GetFileName(filePathName); //文件名 string extension = Path.GetExtension(fileName); //扩展名 string filePath = Path.GetDirectoryName(filePathName); }
标签:
原文地址:http://www.cnblogs.com/xieqianli/p/5126159.html