I am collecting netstat information. the program is working but when in tinyxml for tag it shows null while in console application same program runs successfully
char command[50];
TiXmlElement* msg31 = new TiXmlElement( "Port" );
TiXmlElement childText0( "Type" );
TiXmlNode* childNode0;
CString sTemp;
strcpy( command, "netstat -aon | findstr 3306" );
sTemp.Format(_T("%s"), system(command));
childText0.value = "Mysql_port" ;
childText0.LinkEndChild(new TiXmlText(GetCharArray(sTemp)));
childNode0 = msg31->InsertEndChild( childText0 );
childText0.Clear();
net->LinkEndChild(msg31);
this program runs sucessfully. but only problem is in xml it shows null value. output of xml is as below. what is the problem with code?
Output of XML(you can see Mysql_port is null)
<Network>
<Port>
<Mysql_port>(null)</Mysql_port>
</Port>
</Network>