System.IO.Path

Path.*

string strExtenstion = Path.GetExtension(strPath);
string strFileName = Path.GetFileName(strPath);
string strFilePathDirectory = Path.GetDirectoryName(strPath);

Path.Combine

using System.IO;

string fullName = Path.Combine(FileDirectory, fileName);
string[] paths = {@"d:\archives", "2001", "media", "images"};
string fullPath = Path.Combine(paths);

Sources:

https://docs.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=netframework-4.8

Last modified: July 15, 2019

Author

Comments

Write a Reply or Comment