Share via

Invoke a Intranet shared folder files from Windows scheduler

Pavan 0 Reputation points
2023-12-19T09:28:55.2533333+00:00

We have a Shared Intranet folder having thousand of files in it. We need to access XML files in that folder dynamically and process to existing API's.

Plan: We planned to give input i.,e file name from UI(angular app) and save to azure storage account queue. Using windows scheduler reading values from queue and navigate to respective file and read content in it.

Issue: Saving data and reading data in queue was working fine, but reading data from that file using windows service now working. we tried the blow code to read data from that file.

Ex: we will get "F1" from UI and save it in the queue. we will read the value from the queue and create dynamic file path and read the content from that path.

filepath = "\test\data\F1\ind\F1.xml"

  1. File.ReadAllText(filePath);
  2. string data = new StreamReader(filePath).ReadToEnd();

The above code throwing issue "The specified path is invalid." in event viewer.

Note: The same code working fine in console application.

Please let me know any solutions for this issue or any suggestions to resolve this scenario.

Developer technologies | ASP.NET | ASP.NET Core

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.