private string GetFilePath(string fullPath)
{
string[] pathInfo = fullPath.Split('\\');
if ( pathInfo.Length > 1 )
{
int idx = fullPath.LastIndexOf('\\');
string resultStr = fullPath.Substring(0, idx - 0);
return resultStr;
}
return "";
}
private string GetFileName(string fullPath)
{
string[] pathInfo = fullPath.Split('\\');
if (pathInfo.Length > 1)
{
return pathInfo[pathInfo.Length - 1];
}
return "";
}
private string GetFileNameNoExtend(string fullPath)
{
string fileName = GetFileName(fullPath);
if ( fileName.Length > 0 )
{
string[] extInfo = fileName.Split('.');
c#分解路径文件名扩展名
最新推荐文章于 2022-09-22 10:57:53 发布