判斷網路檔案是否存在(VC原始碼)

2021-08-26 10:59:24 字數 385 閱讀 5091

新建乙個mfc對話方塊程式,新增文字編輯框、按鈕控制項,id分別設為idc_edit_link,idc_btn_check

程式**:

//新增標頭檔案 #include

void cjudgenetfiledlg::onbtncheck()

cstring str;

pf->queryinfo (http_query_status_code, str);//http_query_status_code查詢狀態資訊,這裡可以查詢檔案的大小等等,具體的在http_query_status_code上右鍵,轉到定義,有很多可選項

int b = _ttoi(str);

if (b==404)

else

}vc++6.0編譯通過!

判斷網路檔案是否存在(VC原始碼)

新建乙個mfc對話方塊程式,新增文字編輯框 按鈕控制項,id分別設為idc edit link,idc btn check 程式 新增標頭檔案 include void cjudgenetfiledlg onbtncheck cstring str pf queryinfo http query s...

VC 判斷檔案是否存在

1.使用 access函式,函式原型為 int access const char path,int mode 2.使用createfile函式,函式原型為 handle createfile lpctstr lpfilename,pointer to name of the file dword ...

VC下判斷檔案是否存在

方法1 include include include void main void 方法2 if invalid handle value createfile d a.txt generic read,file share read,null,open existing,file attribu...