TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Austin Muts
1.4k
333
126.4k
Reading files from a folder and converting to Json in C#
May 6 2020 11:29 AM
I have the code below,after retrieving the file i want to convert it to json.
Any help is appreciated.
public
string
DownloadDocument(
string
documentname,
string
documentlocation)
{
string
obj =
string
.Empty;
DirectoryInfo d =
new
DirectoryInfo(documentlocation);
FileInfo[] Files = d.GetFiles();
foreach
(FileInfo file
in
Files)
{
if
(file.Name.Contains(documentname))
{
//want to convert file to json as below but not working
//obj = Newtonsoft.Json.JsonConvert.SerializeObject(file);
}
}
return
obj;
}
Reply
Answers (
2
)
How to login with facebook in .net mvc?
creating list from different columns from different tables