whats the procedure to send the files placed in a listview to a folder.. that is... i need to place all the files in the listview to a folder on button click event.. on button click it should make a folder for all the files in the list view and send them in.. im using winforms in c#.net
A:
To check if the directory exists, use Directory.Exists Method .
To create the directory if it does not exist, use Directory.CreateDirectory Method.
To get all files in a directory, use Directory.GetFiles Method (String, String).
To move files, use File.Move Method .
To copy files, use File.Copy Method
astander
2010-03-09 06:58:40
thanks sir but its general description on how to make fodlers but my issue is that i have the files in the database and im displaying them in the listview..now next step is i need to make the folder for those files in the listview and i need to have the backup for the files also..what is the method to do that??
zoya
2010-03-09 07:30:52
A:
Use Directory.CreateDirectory Method to create a folder.
Then use FileStream class to create new file in that folder.
Copy the contents/data of the file from database to the file stream
When finished close the file stream.
Repeat 2-4 for each file.
logicnp
2010-03-09 09:21:19
can u show me the sample code that will be easier for me to understand...plz show the code using listview..ie files are in the listview
zoya
2010-03-09 10:12:21