當前位置:首頁 » 文件管理 » 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();
}
是否可以解決您的問題?

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:585
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:881
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:574
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:761
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:678
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1005
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:251
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:108
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:799
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:705