Home:ALL Converter>C# download a file from a URL without extension

C# download a file from a URL without extension

Ask Time:2016-02-22T22:19:06         Author:Filippo

Json Formatter

I want to get data from a site by download a web page, but when i put this link "http:\www.championcounter.com\Jinx" as a parameter of this code:

string url = "http:\\www.championcounter.com\Jinx";
string nome = "C:\Temp\data.dat";
WebClient webClient = new WebClient();
webClient.DownloadFile(url, nome );

it give me this error:

System.UriFormatException: URI non valido: impossibile determinare il formato dell'URI.
in System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
in System.Uri..ctor(String uriString)
in LoLCounter.Form.download(String url, String nome) in   c:\users\filippo\documents\visual studio 2015\Projects\LoLCounter\LoLCounter\Form1.cs:riga 39

I think it's because it dosen't find the website because in the url don't have any extension

Author:Filippo,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/35555964/c-sharp-download-a-file-from-a-url-without-extension
yy