当前位置:首页 » 文件管理 » vc添加文件夹

vc添加文件夹

发布时间: 2022-05-19 02:28:49

Ⅰ 用c语言(vc++6.0)怎样建立一个文件夹,具体要求看问题补充

#include
<stdlib.h>
system("md/0x20abc");/*0x20表空格,abc为文件夹名,在system()里添加命令就行了,命令是有长度的喔,不过在C语言中要注意除字母外要用
转义字符
,但是用
字符数组
,再在stytem()里面添加数组名即指针即可,通过键盘输入数组时是不用考虑转义字符*/

Ⅱ vc如何在Application Data目录下建立一个文件夹,然后在在这个新建立的文件夹下建立一个文件夹

建议使用MakeSureDirectoryPathExists函数,CreateDirectory不支持建立多级目录。
Eg:
MakeSureDirectoryPathExists("C:\\Documents and Settings\\Administrator\\Application Data\\1\\2\\");
在Application Data目录下新建了文件夹1,然后在文件夹1下建了文件夹2.
使用MakeSureDirectoryPathExists,需添加头文件及库文件,
#include <imagehlp.h>
#pragma comment(lib,"imagehlp.lib")

Ⅲ VC中如何添加文件夹

你要添加bitmap,cursor。。那些吗

Ⅳ 怎样用vc中新建一个文件夹并同时向该文件夹中存储数据

CreateDirector("name", NULL);
就创建了一个name文件夹了,然后可以在里面建立一个文件,打开,存储,读取。

Ⅳ vc如何添加库文件

在VC中:
tools->options->Directories下,
show
directories
for中找到include
files和library
files,
分别在其中添加新的头文件路径和lib路径,并将其优先!
例:要加shellapi.h和shell32.lib,
添加C:\Program
Files\Microsoft
Visual
Studio\VC98\Include
好,成功!
:)

Ⅵ 用vc怎么根据路径创建文件夹

CStdioFile f;
wchar_t fPath[64];
wsprintf(fPath, L"%s", L"error.txt");
MessageBox(fPath);
if(false==f.Open(fPath,CFile::modeCreate|CFile::modeWrite|CFile::typeText))
{
MessageBox(TEXT("error"));

}
::SYSTEMTIME systime;
::GetSystemTime(&systime);
CString s;
s.Format(L"%d-%d-%d %d:%d:%d",systime.wYear,systime.wMonth,systime.wDay,systime.wHour,systime.wMinute,systime.wSecond);
f.WriteString(s);
f.Close();
这个是MFC的,就是这里CFile::modeCreate|CFile::modeWrite|CFile::typeText #include <fstream.h>#include <iostream.h>void main(){
int i,j;
fstream fs;
fs.open("test.txt",ios::in | ios::out);
while(!fs.eof()){
fs>>i;
if(fs.eof()) break;
cout<<i;
}这个是控制台的

Ⅶ vc++在当前目录中新建文件夹

if(CreateDirectory("Mypath",NULL)) MessageBox("创建文件夹成功!");

会在当前目录创建一个名为 Mypath的子目录

Ⅷ VC++2010如何创建一个文件夹

可以的,这样写:
char cmd[128];
char direct[64];
sprintf( direct, "c::\\as\\fg" );

sprintf( cmd , "md %s" , direct );
system( cmd );

Ⅸ VC++中如何创建文件夹

#include <windows.h>
#include <iostream>
using namespace std;int main()
{
char szDirName[] = "d:\\3";

if( CreateDirectory(szDirName, NULL) )
{
cout<<szDirName<<" : Not Exist"<<endl;
CreateDirectory(szDirName, NULL);
cout<<"Create Successed!"<<endl;
}

return 0;
}

Ⅹ vc编程建立新的文件夹和文件

VC下建立新的文件夹是通过CreateDirectory(path)来完成的,其中path代表的是路径,对文件的操作是通过CFile这个类或者这个的派生类来完成的,在MSDN上有这个类详细的成员函数,你也可以通过C++的输入输出流来完成文件的操作.不过要将CString转换成string
才能行,CString里有个函数就是用来这样的转换的
建立新的文件应该就把路径和文件名一起打进去就行了吧.
要建立一个你那个文件夹下的话,就用一个名为string
filename="c:\\Datei\\newfilename.cpp";在用建立文件的函数建立就应该可以建立名为newfilename.cpp的文件了

热点内容
安卓语音系统哪个更智能 发布:2024-05-17 07:39:44 浏览:475
安卓访客模式app哪个好 发布:2024-05-17 07:38:25 浏览:165
html数据库table 发布:2024-05-17 07:27:56 浏览:993
linux加密程序包 发布:2024-05-17 07:16:18 浏览:472
邮件服务器软件快速搭建 发布:2024-05-17 07:03:53 浏览:281
ipad开机密码怎么找回 发布:2024-05-17 07:03:08 浏览:651
查询账单初始密码是多少 发布:2024-05-17 06:58:45 浏览:650
反编译封挂 发布:2024-05-17 06:17:42 浏览:820
台电怎么从电脑转至安卓 发布:2024-05-17 06:07:23 浏览:436
我的世界国际版服务器里如何开挂 发布:2024-05-17 06:06:05 浏览:873