Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
how to find all files to another destination
Roy Guzman
Jul 18 2017 10:33 AM
189
Reply
I have a file path pointing to a text file on disk, I want to write the details of every file within c:\temp\ overwriting any exisiting text.
this should be in the format ( "<fullName> : <name>" ) Each file data should be on a new line and teh files of all sub-directories should be included.
here is what I have done so far
public static void WriteAllFileDataToDisk(string filePath)
{
var myfile = filePath.AsFile();
var listoffiles = "c:\\temp\\".AsDirectory().GetFiles(true);
foreach (var y in listoffiles)
{
myfile.WriteAllText("{0} : {1}".FormatWith(y.AsFile().FullName, y.AsFile().Name));
}
}
it is not working correctly. please let know if you can help.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to Implement Push Notification in xamarin Form
Check if record exists in DB Mysql c#