1.cè¯è¨å¦ä½å¾å°ç£çååºå称
2.authorwareå¦ä½è·å硬çID
3.Cè¯è¨ è·å硬çç©çå·
cè¯è¨å¦ä½å¾å°ç£çååºå称
代ç å¦ä¸ï¼VS亲æµï¼å¯ä»¥è¿è¡ï¼ç»ä½ 注éçå¾æ¸ æ¥äºï¼ä¸æçå°æ¹å¯ä»¥é®æã
#include <windows.h>
#include <stdio.h>
int main()
{
int DSLength = GetLogicalDriveStrings(0,硬盘源码眼镜网站源码NULL);
//éè¿GetLogicalDriveStrings()å½æ°è·åææ驱å¨å¨å符串信æ¯é¿åº¦ã
char* DStr = new char[DSLength];//ç¨è·åçé¿åº¦å¨å åºå建ä¸ä¸ªcé£æ ¼çå符串æ°ç»
GetLogicalDriveStrings(DSLength,(LPTSTR)DStr);
//éè¿GetLogicalDriveStringså°å符串信æ¯å¤å¶å°å åºæ°ç»ä¸,å ¶ä¸ä¿åäºææ驱å¨å¨çä¿¡æ¯ã
int DType;
int si=0;
for(int i=0;i<DSLength/4;++i)
//为äºæ¾ç¤ºæ¯ä¸ªé©±å¨å¨çç¶æï¼åéè¿å¾ªç¯è¾åºå®ç°ï¼ç±äºDStrå é¨ä¿åçæ°æ®æ¯A:\NULLB:\NULLC:\NULLï¼è¿æ ·çä¿¡æ¯ï¼æ以DSLength/4å¯ä»¥è·å¾å ·ä½å¤§å¾ªç¯èå´
{
char dir[3]={ DStr[si],':','\\'};
//cout<<dir;
DType = GetDriveType((LPCWSTR)DStr+i*4);
//GetDriveTypeå½æ°ï¼å¯ä»¥è·å驱å¨å¨ç±»åï¼åæ°ä¸ºé©±å¨å¨çæ ¹ç®å½
if(DType == DRIVE_FIXED)
{
printf("%c",*dir);
printf("硬ç\n");
}
si+=4;
}
system("pause");//
return 1;
}
authorwareå¦ä½è·å硬çID
C++硬件ç¼ç¨ä¸å¦ä¸ä»£ç å¯ä»¥è·å¾ç¡¬çID,ä½ æ³æ³å¨ä½ çè¿ä¸ªå¤åªä½å¼å软件è½ä¸è½æ··åC++ç¼ç¨:include #include #include #include #include char *GetAscii(unsigned int inData[], int offStart, int offEnd);int main(void){ unsigned intdiskData[];/* Disk data*/unsigned intoffset;/* Disk data offset*/intloop;intnumDrv;/* Number of IDE hard drives*/union REGSregisters;unsigned intbiosCyl[2];/* Cylinders, Heads, Sectors */unsigned intbiosHead[2];unsigned intbiosSec [2];numDrv = peekb(0x, 0x);/* BIOS Data area, Number of Hard disks */for (loop = 0; loop < numDrv; loop++){ while (inp(0xf7) .= 0x);/* Wait for controller not busy*/outp(0xf6, (loop == 0 ? 0xa0 : 0xb0));/* Get first/second drive*/outp(0xf7, 0xec);/* Get drive info data*/while (inp(0x1f7) .= 0x);/* Wait for data ready*/for (offset = 0; offset .= ; offset++) /* Read "sector"*/diskData[offset] = inpw(0x1f0);/* Get BIOS drive info */registers.ah = 0x;/* Get drive info*/registers.dl = 0x + loop; /* Drive is H for Disk 0, H for Disk 1 */int(0x, ?isters, ?isters);if (.registers.cflag)/* All OK if carry not set */{ biosHead[loop] = registers.dh + 1;/* Heads are from 0 */biosSec[loop]= registers.cl & 0x3f;/* sec is bits 5 - 0 *//* +1 because starts from 0 and +1 for FDISK leaving one out */biosCyl[loop]= ((regiå¸æå¯¹ä½ æ帮å©ã
è®°å¾é纳å
Cè¯è¨ è·å硬çç©çå·
è·åç大å¤æ°æ¯ç£çåºåå·èå·²
ç©çå·ä¸å®¹æè·å
å¯ä»¥åèä¸
//
å°±äºé»è¾åºåå·èè¨
ææVBæ¹åæCçï¼å¯ä»¥åèä¸ï¼
#include
#include
main()
{
DWORD
VolumeSerialNumber;
char
VolumeName[];
GetVolumeInformation(
"c:\\
",
VolumeName,,
&VolumeSerialNumber,
NULL,NULL,NULL,
);
printf("cççå·æ ï¼%s
\n",VolumeName);
printf("cççåºåå·ï¼%ld
\n",VolumeSerialNumber);
}
2024-11-06 12:311851人浏览
2024-11-06 12:12384人浏览
2024-11-06 11:472306人浏览
2024-11-06 10:24317人浏览
2024-11-06 10:211093人浏览
2024-11-06 10:022619人浏览
中秋連假即將到來,但氣象署表示,這個週末23、24日)在菲律賓東方海面有熱帶擾動系統生成的可能,但模擬的位置及生成時間還有待後續觀察。而天氣風險分析師吳聖宇也指出,等到實際有熱帶擾動系統開始出現時,再
環境資訊中心記者 廖禹婷報導立法院司法及法制、經濟委員會聯席會議3月15日併案審查農業部組織法等案,農委會主管陳吉仲、副主委陳駿季列席報告並備質詢。針對近來的缺蛋問題,農委會表示4月可望紓解。立委除了