We can use OpenFileDialog.FileName to get file path easily.
But,how can we do to get the file name?
There is a good function to do this work.
If the SourceFilename is C:\Users\Hacks\Downloads\text.txt
String fileName = Path.GetFileNameWithoutExtension(SourceFilename);And the fileName is "text".
沒有留言:
張貼留言