Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to change folder to file without using third party software and dll's in c# win. form?

[Note:Just want conversion of folder to file no compression at all is needed]

Thanks in advance
Posted

as you scan through all the files save the file name and size in a separate file. then add the number of files, and this file of information to the top of the appended files.

This is just a "off the top of my head" idea, but the main thing is just save whatever information you need to restore the files as a header in the same file.
 
Share this answer
 
I think you mean "how do a I copy all the files in a folder to one big file".

Open the file you want append everything to.
Use something like Directory.GetFiles to get all the names of the files in the folder.
For each file, open it and append the whole thing to your main append file.
Then for each folder in the current folder, repeat the above process.

Generally, recursion is used to go through all the sub-folders.

see
C# FileSearch[^]

for an example of using c# to recurse through a folder structure.
 
Share this answer
 
Comments
agent_kruger 19-Dec-14 20:56pm    
yes my friend you understood me right and how can i do this without loosing the heading of each file?

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