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;
- }
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Austin MutsPosted May 7, 2020, 5:00 AM
Amit GuptaPosted May 6, 2020, 11:58 AM