Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to move some files to destination directory.

If a file name already exists I want to store in a list

How to store the files while are not moved
Posted

1 solution

"How to store the files while are not moved"

Anywhere you like I'd say.
Here's a small list for your convenience:


  1. Use a collection, best use a generic collection like List<String> or List<FileInfo>.*1
  2. Use an array or an arraylist. (Not recommended).
  3. Store the paths to these files in a textfile.
  4. Store the paths in a RDMBS or a NoSQL DB.


*1
C#
// Before the loop processing the files
List<String> notMovedFiles = new List<String>();


// This is inside the loop processing the files
if(fileNotMoved)
{
    notMovedFiles.Add(theFilePath); 
}



Cheers!
 
Share this answer
 
v2
Comments
KUMAR619 13-Feb-14 3:20am    
Can you explain with codes I am in urgent please
Manfred Rudolf Bihy 13-Feb-14 3:44am    
Answer modified, please see.
Maybe you should also edit your question and show us what you've tried sofar.

And one more thing: Maybe it's urgent for you, but not for us.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900