CreateDirectory Function (Windows)
BOOL WINAPI CreateDirectory(
__in LPCTSTR lpPathName,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
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
Code:#using <mscorlib.dll> using namespace System; using namespace System::IO; int main() { // Specify the directory you want to manipulate. String* path = S"c:\\"; 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); } }
Last edited by @osma8; 02-24-2011 at 11:12 PM.
CreateDirectory Function (Windows)
BOOL WINAPI CreateDirectory(
__in LPCTSTR lpPathName,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
Ah we-a blaze the fyah, make it bun dem!
Directory::Create(S"C:\\freedompeace");
Managed... ewww
Hell_Demon (02-24-2011)
Thanks guys
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
ғᴜᴋᴏᴊʀ (02-25-2011),'Bruno (02-25-2011),mookamoka3 (02-27-2011),Stephen (02-25-2011),why06 (02-25-2011)