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

熱點內容
linux控制面板 發布:2025-07-03 07:48:44 瀏覽:429
mysql復制資料庫及數據 發布:2025-07-03 07:39:36 瀏覽:800
java運行下載 發布:2025-07-03 07:39:29 瀏覽:11
simditor圖片上傳 發布:2025-07-03 07:35:34 瀏覽:884
php簽到代碼 發布:2025-07-03 07:27:38 瀏覽:572
pc反編譯apk 發布:2025-07-03 07:26:15 瀏覽:455
東風多利卡油罐車配置有哪些 發布:2025-07-03 07:17:42 瀏覽:110
莫高窟的無線網路密碼是多少 發布:2025-07-03 07:08:25 瀏覽:57
win10u盤怎麼隱藏的文件夾 發布:2025-07-03 07:07:03 瀏覽:28
安卓系統10什麼時候發布 發布:2025-07-03 07:06:16 瀏覽:20