Thread: Problem with enum and files

  1. #1
    Master At Novice
    Join Date
    Oct 2005
    Cardassia & Canada, eh!

    Problem with enum and files

    Hi there, I'm having a problem that's probably pretty easy to fix.

    I am trying to get information from a directoryInfoBox, post that as working directory, then create a directory from a textBox and move all the files into it.
    The thing is, it will only create the directory, I don't think it's reading any files at all,
    Here's the code, if you need more of it I'll post more:

    private: System::Void button1_Click(System::Object *  sender, System::EventArgs *  e)
    		//To String Button
    //Create Dir:	Dialog Selected\TextBox1 Text
    //Move:			Files_In_Enumerator To Dialog Selected\TextBox1 Text
    //Path:			Selected Path
    //Path2:		Selected Path\TextBox1 Text
    //Di:			Create Directory: "Path2"
    //Movepath:		Dialog Selected\TextBox1 Text\
    			System::String* path1 = folderBrowserDialog1->SelectedPath;
    			System::String* path2 = String::Concat(path1, S"\\", textBox1->Text);
    			DirectoryInfo* di = Directory::CreateDirectory(path2);
    			DirectoryInfo* dui = new DirectoryInfo (path2);
    			FileInfo* fi[] = dui->GetFiles();
    			Collections::IEnumerator* myEnum = fi->GetEnumerator();
    			int i=0;
    			while (myEnum->MoveNext()) 
    				FileInfo* fiTemp = __try_cast<FileInfo*>(myEnum->Current);
    				File::Move(myEnum->Current->ToString(), path2);
    Any help is greatly appreciated!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. which command can be used instead of enum for long integers?
    By aarti_gehani in forum C Programming
    Replies: 3
    Last Post: 03-03-2009, 04:05 AM
  2. Conflicting enum issue
    By 7force in forum C Programming
    Replies: 1
    Last Post: 07-05-2006, 03:51 AM
  3. Enum or Const Ints?
    By Syneris in forum C++ Programming
    Replies: 5
    Last Post: 01-20-2006, 04:58 AM
  4. Problems with Enum and Files
    By Robert_Sitter in forum Windows Programming
    Replies: 7
    Last Post: 11-25-2005, 04:31 PM
  5. SHELL – Path problem 2
    By geek@02 in forum Windows Programming
    Replies: 1
    Last Post: 04-29-2004, 10:54 PM