?? filetype.h
字號:
#define XLS 0x01
#define DOC 0x02
#define PPT 0x03
#define PDF 0x04
#define EXE 0x05
#define ZIP 0x06
#define RAR 0x07
#define RM 0x08
#define SWF 0x09
#define TXT 0x0a
#define AVI 0x0b
#define BMP 0x0c
#define JPG 0x0d
#define Type_xls "application/vnd.ms-excel"
#define Type_Doc "application/msword" //"application/vnd.ms-word"
#define Type_Ppt "application/vnd.ms-powerpoint"
#define Type_Pdf "application/pdf"
#define Type_Exe "application/x-msdownload"
#define Type_Zip "application/zip"
/*
.zip,application/x-zip-compressed
.exe,application/octet-stream
.dll,application/x-msdownload
.avi,video/x-msvideo
.asf,video/x-ms-asf
.vbs,text/vbscript
.bmp,image/bmp
.vss,application/vnd.visio
*/
#define Type_Rar "application/octet-stream"
#define Type_Rm "application/vnd.rn-realmedia"
#define Type_Swf "application/x-shockwave-flash"
#define Type_Txt "text/plain"
#define Type_Wav "audio/wav"
#define Type_Wma "audio/x-ms-wma"
#define Type_Jpg "image/jpeg"
const type_zip[3] = {0x50,0x4b};
const type_rar[5] = {0x52,0x61,0x72,0x21};
const type_exe[3] = {0x4d,0x5a};
const type_swf[3] = {0x57,0x53};
const type_avi[5] = {0x52,0x49,0x46,0x46};
const type_bmp[3] = {0x42,0x4d};
const type_jpg[5] = {0x4a,0x46,0x49,0x46};
const type_gif[4] = {0x47,0x49,0x46};
const type_png[4] = {0x50,0x4e,0x47};
const type_rm[4] = {0x52,0x4d,0x46};
const type_mp3[4] = {0xff,0xfb,0x30};
const type_pdf[5] = {0x25,0x50,0x44,0x46};
const type_doc[9] = {0xd0,0xcf,0x11,0xe0,0xa1,0xb1,0x1a,0xe1};
int filetype(void* buffer, int buflen)
{
if(memcmp(buffer, type_zip) == 0) return ZIP;
if(memcmp(buffer, type_rar) == 0) return RAR;
if(memcmp(buffer, type_exe) == 0) return EXE;
if(memcmp(buffer, type_swf) == 0) return SWF;
if(memcmp(buffer, type_avi) == 0) return AVI;
if(memcmp(buffer, type_bmp) == 0) return BMP;
if(memcmp(buffer, type_jpg) == 0) return JPG;
// if(memcmp(buffer, type_gif) == 0) return GIF;
// if(memcmp(buffer, type_png) == 0) return PNG;
if(memcmp(buffer, type_rm) == 0) return RM;
// if(memcmp(buffer, type_mp3) == 0) return MP3;
if(memcmp(buffer, type_pdf) == 0) return PDF;
if(memcmp(buffer, type_doc) == 0) return DOC;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -