Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // • Liệt kê mẫu trong tệp dữ liệu
- FILE *f;
- char strPathSign[]="mn.kkt";
- fopen_s(&f,strPathSign,"rb");
- m_Sign sign;
- char chuoi[18]="";
- System::String ^tmp="";
- int i=0;
- int posEnd;
- //Xác định kích thước file
- fseek(f,0,SEEK_END);
- posEnd=ftell(f);
- //Trả về vị trí ban đầu
- fseek(f,0,SEEK_SET);
- //Tiến hành vòng lặp liệt kê mã nhận dạng
- while (ftell(f) < posEnd)
- {
- i++;
- fread(&sign,sizeof(m_Sign),1,f);
- strncpy(chuoi,sign.Name,17);
- tmp = gcnew System::String(chuoi);
- lstVirus->Items->Add(tmp);
- };
- fclose(f);
- lblCount->Text=Convert::ToString(i);
Advertisement
Add Comment
Please, Sign In to add comment