Thread: Folders

Results 1 to 9 of 9
  1. #1
    @osma8's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    749
    Reputation
    26
    Thanks
    84

    Folders

    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.

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    CreateDirectory Function (Windows)

    BOOL WINAPI CreateDirectory(
    __in LPCTSTR lpPathName,
    __in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes
    );
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Directory::Create(S"C:\\freedompeace");

  4. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Managed... ewww

  5. The Following User Says Thank You to 'Bruno For This Useful Post:

    Hell_Demon (02-24-2011)

  6. #5
    @osma8's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    749
    Reputation
    26
    Thanks
    84
    Thanks guys

  7. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Brinuz View Post
    Managed... ewww
    Idk, if you can even call it that.

    "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

  8. #7
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by why06 View Post


    Idk, if you can even call it that.
    Managed is awesome

  9. #8
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by freedompeace View Post


    Managed is awesome
    Ah we-a blaze the fyah, make it bun dem!

  10. The Following 5 Users Say Thank You to Hell_Demon For This Useful Post:

    ғᴜᴋᴏᴊʀ (02-25-2011),'Bruno (02-25-2011),mookamoka3 (02-27-2011),Stephen (02-25-2011),why06 (02-25-2011)

  11. #9
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,689
    Reputation
    184
    Thanks
    1,149
    My Mood
    Aggressive
    Quote Originally Posted by Hell_Demon View Post
    Emote Spam = Ban.
    (But I think it is allowed in this case.)