问题描述
VB2005如何分别得到OpenFileDialog控件选中的文件?名和路径
解决方案
解决方案二:
System.IO.Path.GetFullPath(openFileDialog1.FileName)System.IO.Path.FileName(openFileDialog1.FileName)
解决方案三:
System.IO.Path.GetDirectoryName(openFileDialog1.FileName)System.IO.Path.GetFileName(openFileDialog1.FileName)
解决方案四:
在老大楼下沾沾光
解决方案五:
tryDimopenFileDigAsNewOpenFileDialog()openFileDig.DefaultExt="*.txt;*.rtf"openFileDig.Filter="文本文档(*.txt)|*.txt|RTF格式(*.rtf)|*.rtf|所有文件(*.*)|*.*"IfopenFileDig.ShowDialog()=DialogResult.OKThenDimfileNameAsString=System.IO.Path.GetFileNameWithoutExtension(openFileDig.FileName)DimfullPathAsString=openFileDig.FileNameDimpathAsString=System.IO.Path.GetPathRoot(openFileDig.FileName)MessageBox.Show(fileName)MessageBox.Show(fullPath)MessageBox.Show(path)EndIf
解决方案六:
路过。
时间: 2025-01-02 05:58:52