WINCE 读取U盘ID号
读取 U 盘物理序列号 // usb.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" /************************************************************* Win32 控制台应用程序 编译环境:Visual Studio 2005 主要功能: 1). 读取U盘序列号,保存在USBSerial数组里。 2). 验证 第一次运行程序读取U盘序列号存放在 C:\Windows\system32\USBSerial.dat文件中 以后运行检验读取到的U盘序列号与保存在文件中的是否一致, 若相同,置 gTag 为1; 若不一致,置 gTag 为0; ***********************************************************/ #include<windows.h> #include <winioctl.h> #include <stdio.h> #include <initguid.h> #include <setupapi.h> #include <string.h> #pragmacomment(lib,"setupapi.lib") wchar_tUSBSerial[5][100] = {TEXT("")}; int gTag = 0;