0

im new here. Please dont judge me if i did anything wrong :)

I have a IIS Server with many Pictures in it with the Path:

"https://IISserver/pictures/"

under this path are Pictures with names like:

"https://IISserver/pictures/312-33334-4444.jpg"

"https://IISserver/pictures/111-23454-4441.jpg"

I activated Directory Browsing in the web.config of the IIS Server.

Actually im working with

httpClient = new httpClient();

HttpResponseMessage message = await httpClient.GetAsync(URL);

So all what i want is a list with all dirctorys of this site. Is this possbile? Please help me.

Maddin
  • 52
  • 9

1 Answers1

0

You can create JSON service which returns list of Files and Directories.

PSEUDO CODE

DirectoryInfo d = new DirectoryInfo(@"D:\Test");//Assuming Test is your Folder
FileInfo[] Files = d.GetFiles("*.txt"); //Getting Text files
string str = "";
foreach(FileInfo file in Files )
{
  str = str + ", " + file.Name;
}

ref: https://www.c-sharpcorner.com/UploadFile/db2972/json-result-in-controller-sample-in-mvc-day-13/

Nitin Sawant
  • 7,278
  • 9
  • 52
  • 98