mfc字符串截取-程序路径,文件扩展名等
来源:互联网 发布:时间序列预测 python 编辑:程序博客网 时间:2024/05/23 23:00
//在全路径获取文件名
//const CString & localFileName
wchar_t tempStr[100]; //storage the file name
memset(tempStr,0,100);
int strLen = localFileName.GetLength();
int i = strLen - 1;
int fileLen = 0;
while (localFileName[i] != '//')
{
i--;
}
while(i++ < strLen)
{
tempStr[fileLen++] = localFileName[i];
}
//获取文件扩展名
int i = fileName.GetLength() - 1;
wchar_t fileType[10];
memset(&fileType,0,10);
while(fileName[i] != '.' && i != 0)
{
i--;
}
if (i == 0)
{
return NULL;
}
else
{
int j = i + 1;
int k = 0;
while(j < fileName.GetLength())
{
fileType[k++] = fileName[j++];
}
CString type = fileType;
}
//更改文件后缀名
wchar_t strResult[200];
memset(strResult,0,200);
int StrLen = zipPath.GetLength();
for(int i = StrLen; i > 0; i--)
{
if (zipPath[i] == '.')
{
wcsncpy_s(strResult, zipPath,i);
break;
}
}
CString iniPath = strResult;
iniPath.Append(L".ini");
- mfc字符串截取-程序路径,文件扩展名等
- java文件路径截取字符串
- C# 通过文件路径获取文件名、扩展名等
- C# 通过文件路径获取文件名、扩展名等
- C# 截取带路径的文件名字,扩展名,等等 的几种方法.
- C# 截取带路径的文件名字,扩展名,等等 的几种方法
- C# 截取带路径的文件名字,扩展名,等等 的几种方法.
- c++MFC 截取字符串
- 由文件路径获得扩展名
- Java--截取路径字符串
- Java--截取路径字符串
- Java--截取路径字符串
- Java--截取路径字符串
- PHP 获取文件扩展名非截取
- lua中如何截取字符串(比如截取文件路径字符串中的文件名)
- 截取文件路径
- C#控制台基础 处理表示文件路径的字符串得到文件名与扩展名
- 文件路径类 字符串的各种截取方式,包括截取到文件名
- 单链表
- strcat 字符串连接
- Xml WebService完全实例解析(三)
- FCKEditor2.6 For Jsp With FCKEditor-java-2.6
- c++ 字符类型总结
- mfc字符串截取-程序路径,文件扩展名等
- 111111111111111
- 通过IP查询城市天气预报(抓取sina网天气预报)
- BITWAVE无线监控系统为矿山/矿区安全护航
- 文件型GIS数据的读写操作入门
- 学校在打劫
- VC 开机自动启动程序代码
- 这一刻我被深深地震精了![视频]Visual Studio最新"煽情"广告 - 让我做你下一行code
- 各行业的英语术语(绝对精华3)