?? 88.c
字號:
#include <graphics.h>
#include <dos.h>
#include <bios.h>
#include <stdio.h>
/*測試顯卡*/
void DetectGraphicadapter()
{
int gdriver, gmode;
puts("The information of graphics adapter is :\n");
detectgraph(&gdriver, &gmode);
if(gdriver==-2)
{
printf(">>no graphics adapter in the computer\n");
}
else
{
printf(">>Driver is %d.\n", gdriver); /*輸出測試結果*/
printf(">>Mode is %d.\n\n",gmode);
}
}
/*測試硬盤*/
void DetectDisk()
{
struct dfree diskfree;
struct fatinfo fileinfo;
puts("The information of the current disk is :\n");
getdfree(0,&diskfree);
getfat(0,&fileinfo);
puts("----------------- disk space ------------------");
printf(">>The num of avaible clusters is : %d\n",diskfree.df_avail);
printf(">>The num of all clusters is : %d\n",diskfree.df_total);
printf(">>The num of bytes of every sector is : %d\n",diskfree.df_bsec);
printf(">>The num of sectors of every cluster is : %d\n",diskfree.df_sclus);
puts("----------- file allocation table -------------");
printf(">>The num of sectors of every cluster is : %d\n",fileinfo.fi_sclus);
printf(">>The num of bytes of file allocation table is : %d\n",fileinfo.fi_fatid);
printf(">>The num of clusters is : %d\n",fileinfo.fi_nclus);
printf(">>The num of ytes of every sector is : %d\n",fileinfo.fi_bysec);
}
int main()
{
/*測試顯卡*/
DetectGraphicadapter();
puts("Press any key to detect the disk...");
getch();
/*測試硬盤*/
DetectDisk();
getch();
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -