首页
社区
课程
招聘
[原创]nsSplitPathName
发表于: 2013-7-7 13:31 3657

[原创]nsSplitPathName

2013-7-7 13:31
3657
提取全路径文件的名称
bool nsSplitPathName(char* pPath,char* pName)
{
char* pPathEnd = static_cast<char*>(strlen(pPath)+pPath);
while((*pPathEnd!='\\')&&((--pPathEnd)>pPath));
if(pPathEnd>pPath)
{
while(*pPathEnd=='\\'&&*(++pPathEnd)!=0);
strncat(pName,pPathEnd,strlen(pPathEnd));
return true;
}
else
{
return false;
}
}

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 402
活跃值: (342)
能力值: ( LV2,RANK:140 )
在线值:
发帖
回帖
粉丝
2
PathFindFileName
2013-7-7 14:25
0
雪    币: 778
活跃值: (208)
能力值: ( LV9,RANK:260 )
在线值:
发帖
回帖
粉丝
3
还有GetFileTitle也行,顺便借地发个自己写的命令行转换成路径的方法

VOID CommandLineToPath(LPTSTR pszCommandLine, LPTSTR pszPath)
{
	LPTSTR			pStr;
	
	pStr = pszCommandLine;
	while(*pStr != '-' && *pStr != '/' && *pStr != '\0')
	{
		pStr = PathGetArgs(pStr);//获取路径参数
	}

	if(*pStr == '\0')
		lstrcpy(pszPath, pszCommandLine);
	else
		lstrcpyn(pszPath, pszCommandLine, (INT)(pStr - pszCommandLine));

	PathRemoveBlanks(pszPath);//移除空格
	PathUnquoteSpaces(pszPath);//移除双引号
}
2013-7-7 14:29
0
雪    币: 278
活跃值: (709)
能力值: ( LV15,RANK:520 )
在线值:
发帖
回帖
粉丝
4
还有GetFileTitle也行,顺便借地发个自己写的命令行转换成路径的方法


Linux下面能编译?
2013-7-7 16:16
0
雪    币: 1
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
使用宏定义某些函数,当然是可以编译的..
2013-7-7 17:19
0
雪    币: 278
活跃值: (709)
能力值: ( LV15,RANK:520 )
在线值:
发帖
回帖
粉丝
6
求教如何宏定义?
2013-7-7 17:47
0
游客
登录 | 注册 方可回帖
返回
//