當前位置:首頁 » 文件管理 » c打開電腦文件夾

c打開電腦文件夾

發布時間: 2024-01-03 01:40:24

① 怎麼打開C盤默認共享文件夾(C$)!!

1、首先打開電腦,之後點擊電腦桌面中的開始菜單,如下圖所示。

c語言opendir打開文件夾,完整程序

#include<stdio.h>
#include <sys/types.h>
#include <dirent.h>

int main()
{
DIR *dfd;
dfd = opendir("文件夾名稱");
closedir(dfd);
//想讀取文件夾,用readdir
return 0;
}

③ c語言如何打開文件

你只要把下面代碼的file_path改成你要輸出的文件就可以了。注意,一般window下的文件路徑都是一個反斜杠,但是在file_name的字元串中,所有的反斜杠都寫成兩個反斜杠。比如
E:\abc\WTK\SW\source.txt
你要寫成
E:\\abc\\WTK\\SW\\source.txt

#include <stdio.h>
#include <string.h>

main()
{
FILE *fp;
char ch;
char *file_path = "C:\\test\\myfile.txt";

if((fp=fopen(file_path,"r"))==NULL)
{
printf("\nSorry, Can't open the file! @_@\n");
exit(0);
}
else
{
while((ch=fgetc(fp))!=EOF)
{ printf("%c",ch); }
fclose(fp);
}

getch();
}
是否可以解決您的問題?

熱點內容
app框架源碼 發布:2025-09-13 19:17:56 瀏覽:922
sql資料庫的修復軟體 發布:2025-09-13 19:14:13 瀏覽:300
java短期培訓多少錢 發布:2025-09-13 18:32:52 瀏覽:619
鳥哥的linux私房菜架設 發布:2025-09-13 18:24:18 瀏覽:111
ts緩存編譯 發布:2025-09-13 18:14:58 瀏覽:525
哈弗h6盲區監測哪個配置有 發布:2025-09-13 17:32:39 瀏覽:199
sql2000遞歸 發布:2025-09-13 17:25:09 瀏覽:250
雲伺服器動態配置 發布:2025-09-13 17:25:07 瀏覽:741
數字支付密碼在哪裡 發布:2025-09-13 17:24:24 瀏覽:131
源碼圈資源網 發布:2025-09-13 17:24:24 瀏覽:479