int FileZone::write(int zone,const std::string& coilid,ZONE_ROWS* zone_rows)
{
ostringstream ostr1; //int 转string
stringstream ss;
ss << zone;
string s1 = ss.str();
string name=s1;
SYSTEMTIME st = {0};
GetLocalTime(&st); //创建时间层级文件夹
ostr1<<"d:"<<"\\\\"<<st.wYear<<"\\\\"<<st.wMonth<<"\\\\"<<st.wDay;
string s=ostr1.str();
CreateDir(s.c_str());
ostr1<<"\\\\"<<name<<".dat";
s=ostr1.str();
ofstream fout(s.c_str(),ios::app); //创建文件,并定义到文件末尾
for(int i=0;i<10;i++)
fout<<zone_rows[0][i].index<<" "<<zone_rows[0][i].offset<<" "<<zone_rows[0][i].ti<<" "<<zone_rows[0][i].entId[20]<<" "<<zone_rows[0][i].extId[20]<<" "<<zone_rows[0][i].data[63]<<endl;
fout.close();
return 1;
}