Hey guys, im still a beginner and was wondering how I could create a program that creates an amount of files that the user inputs then creates the files at a directory that the user has chosen
I have successfully created a folder in the project folder but thats about it.
Thanks.
Found this and tried it on a win32 app but it didnt work
I have successfully created a folder in the project folder but thats about it.
Thanks.
Found this and tried it on a win32 app but it didnt work
Code:
#using <mscorlib.dll>
using namespace System;
using namespace System::IO;
int main() {
// Specify the directory you want to manipulate.
String* path = S"c:\\Users\\Faizal";
try {
// Determine whether the directory exists.
if (Directory::Exists(path)) {
Console::WriteLine(S"That path exists already.");
return 0;
}
// Try to create the directory.
DirectoryInfo* di = Directory::CreateDirectory(path);
Console::WriteLine(S"The directory was created successfully at {0}.",
__box(Directory::GetCreationTime(path)));
// Delete the directory.
di->Delete();
Console::WriteLine(S"The directory was deleted successfully.");
} catch (Exception* e) {
Console::WriteLine(S"The process failed: {0}", e);
}
}