c#中怎么获取当前文件的绝对路径
1个回答
展开全部
var 当前可执行文件的绝对路径 = System.Environment.CurrentDirectory;
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "Audio Files (*.*)|*.*";
dialog.ShowDialog();
var 选择文件的绝对路径 = dialog.FileName.Remove(dialog.FileName.LastIndexOf ("\\"));
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "Audio Files (*.*)|*.*";
dialog.ShowDialog();
var 选择文件的绝对路径 = dialog.FileName.Remove(dialog.FileName.LastIndexOf ("\\"));
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询