WebClient download save as the filename substring from url
static void WebClientDownLoadFileDemo() { string url = "http://dl.booktolearn.com/ebooks2/computer/gamedevelopment/9781789532050_Learning_C_Unity_2019_4514.pdf"; string fileName =url.Substring(url.LastIndexOf("/")+1); using(WebClient wc=new WebClient()) { wc.DownloadFile(url, fileName); } Console.WriteLine("Finished!"); }