#include <iostream> #include <windows.h> #include <iostream> #include <tchar.h> using namespace std; int main() { // Получаем тип носителя с которого запущена программа unsigned int drive_type = GetDriveType( NULL ); char VolumeNameBuffer[100]; char FileSystemNameBuffer[100]; DWORD sz,fs; unsigned long drive_sn; GetVolumeInformationA( NULL, VolumeNameBuffer, 100, &drive_sn, sz, fs, FileSystemNameBuffer, 100 ); cout << "Volume serial number:\t"; if(drive_sn == 1018821877) //сравниваем серийный номер cout << "correct" << endl; else cout << "invalid" << endl; cout << "Drive type:\t"; if(drive_type == DRIVE_REMOVABLE) cout << "correct" << endl; else cout << "invalid" << endl; getch(); }