I am trying to use Enum to work with files from a directory chosen from a directory chooser but it doesn't seem to work.
Could someone help me out with this code?
Thanks for any help!Code:private: System::Void button1_Click(System::Object * sender, System::EventArgs * e) { //To String Button //--------- //Goal: //Create Dir: Dialog Selected\TextBox1 Text //Then, //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); i++; } }
Rob Sitter



LinkBack URL
About LinkBacks


