What would be the easiest way to separate the directory name from the file name when dealing with SaveFileDialog.FileName
in C#?
Use:
System.IO.Path.GetDirectoryName(saveDialog.FileName)
(and the corresponding System.IO.Path.GetFileName
). The Path class is really rather useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With