📄 stdafx.cpp
字号:
// stdafx.cpp : source file that includes just the standard includes
// MTTest.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
//提取XML中的指定标签的内容
int getXMLTagValue(CString &strXML, CString strTag, CString &strValue)
{
CString strFind1, strFind2;
int nPos1, nPos2;
strFind1 = "<" + strTag + ">";
if((nPos1=strXML.Find(strFind1)) == -1)
{
strFind1 = "<" + strTag + " ";
if((nPos1=strXML.Find(strFind1)) == -1)
{
return -1;
}
else
{
nPos1 = strXML.Find(">", nPos1);
if(nPos1 == -1)
{
return -1;
}
else
{
nPos1 += 1;
}
}
}
else
{
nPos1 += strFind1.GetLength();
}
strFind2 = "</" + strTag + ">";
nPos2 = strXML.Find(strFind2, nPos1);
if(nPos2 == -1)
{
return -1;
}
strValue = strXML.Mid(nPos1, nPos2-nPos1);
return nPos2;
}
//提取XML中的指定标签的指定属性的值
int getXMLTagPropValue(CString &strXML, CString strTag, CString strProperty,CString &strValue)
{
CString strFind1;
int nPos1, nPos2;
strFind1 = "<" + strTag + " ";
if((nPos1=strXML.Find(strFind1)) == -1)
{
return -1;
}
nPos2 = strXML.Find(">", nPos1);
if(nPos1 == -1)
{
return -1;
}
CString str;
str = strXML.Mid(nPos1, nPos2-nPos1);
nPos1 = str.Find(strProperty);
nPos1 += strProperty.GetLength()+2;
nPos2 = str.Find("\"", nPos1);
strValue = str.Mid(nPos1, nPos2-nPos1);
return nPos2;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -