[Solved] How To Download HTML File Name As A String?


Explanation about the error:

WebClient.DownloadFileAsync

public void DownloadFileAsync(
    Uri address,
    string fileName
)

It doesn’t return anything (void) and you are passing this to listsext! Ofcourse you will get an Exception:

Cannot implicitly convert type ‘void’ to ‘string’

What you want to achieve: (my guess, not much information given)

You want to have the filename, you don’t need to download it.

Uri u = new Uri("http://rotter.net/scoopscache.html")
filename = Path.GetFileName(u.LocalPath);

See here: Get file name from URI string in C#

2

solved How To Download HTML File Name As A String?