Тёмный

C# Tutorial - How to Download a File from Internet | FoxLearn 

Fox Learn
Подписаться 94 тыс.
Просмотров 46 тыс.
50% 1

C# Download file from URL/Internet with Progress Bar in C#.NET Winforms using C# Webclient. The C# Basics beginner course is a free C# Tutorial Series that helps beginning programmers learn the basics of the C# Programming Language.
Website: foxlearn.com
How to Download a File from Internet using C#
Downloading With Progressbar In C#
How To Download an Internet File with C#
How to download file from Internet in c#
How to download a file from a URL in C#
WebClient.DownloadFile in c#
Download Files from Web C# Examples
How to download a file in C# (progress bar and download speed)

Опубликовано:

 

13 май 2016

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 105   
@sirrooster1541
@sirrooster1541 4 года назад
Thanks! It works, however, I want to save the file to a specific location. I want to make it so when you hit "Download", it opens the popup to choose the file location.
@cosasVariadasAM
@cosasVariadasAM 7 лет назад
Excelente.!!!!!!!!!!!!
@flawless5571
@flawless5571 8 лет назад
Thanks! Your my favorite programming yt channel!
@foxlearn
@foxlearn 8 лет назад
+Allround Fred Thank you ^_^
@AceTv123
@AceTv123 6 лет назад
please send source code at jagamer759@gmail.com
@d7nomi
@d7nomi 7 лет назад
An unhandled exception of type 'System.NullReferenceException' occurred in Downloader.exe receiving this error while executing
@kifkifa56
@kifkifa56 6 лет назад
Solved! Many have commented that file downloaded with zero bytes so I tried this on console application and solved this problem by just putting Console.Read(); after wc.DownloadFileAsync() method .... This is because without console.read(); the program exits before the file downloaded completely.
@Luc_Skywalker
@Luc_Skywalker 7 лет назад
this is fine when you know the file your going to download. If you were to download a file from WebBrowser to save on your computer, unknown file extension, now, how to catch that would be helpful!
@utensilenjoyer6099
@utensilenjoyer6099 4 года назад
can anyone help, i want to make it so the download link is already preset and all you have to do is hit download
@tanhynh5514
@tanhynh5514 8 лет назад
Really useful. Thanks
@foxlearn
@foxlearn 8 лет назад
+James Jonathan Thanks
@tobe2624
@tobe2624 3 года назад
I have an error about 'Invalid URI: The format of the URI could not be determined.' Can you help me! Thanks a lot!!!
@Montick
@Montick 4 года назад
I have a problem in this line when i'm trying to download an iso file from Mediafire :c client.DownloadFileAsync(uri, Application.StartupPath + "/" + fileName);
@foxlearn
@foxlearn 4 года назад
You can't download file from media, you should get real link download, then you can download
@Montick
@Montick 4 года назад
@@foxlearn i fix it, just i need create the object WebClient like this: WebClient client = new WebClient(); and it just works, lol
@rocketengine9337
@rocketengine9337 5 лет назад
How i can Sync progress bar when i download différents file in different directory ? With ini file. .. like Reading ini file and getting directory and Name of files from my website
@foxlearn
@foxlearn 5 лет назад
You can use the asyn and wait
@rocketengine9337
@rocketengine9337 5 лет назад
Fox Learn how Can i get the Name of all files to show them via a label when its downloading pls
@TechTips17
@TechTips17 6 лет назад
Can i select a folder where to save the downloaded files? if so how?
@SlyHadoken
@SlyHadoken 5 лет назад
Use Folder open Dialog instead of open file dialog , FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == DialogResult.OK) { string folderPath = Path.GetDirectoryName(fbd.SelectedPath); Download.Text = fbd.SelectedPath; }
@nataliaguadalupegonzalezce2283
@nataliaguadalupegonzalezce2283 4 года назад
what if I want to download another type of files and save it in another folder outside the project?
@foxlearn
@foxlearn 4 года назад
You can do the same way. enter your url file name, then download it
@softmetric6140
@softmetric6140 4 года назад
Hello Fox Learn, please apply for a free SSL certificate from let's encrypt authority. It's better than Cloudflare. Anyway, great tutorial!
@manjeetnandal1
@manjeetnandal1 4 года назад
Hey FoxLearn! How we can capture download from chrome? Same as IDM. Can you please give us solution for this. Thanks in advance!
@foxlearn
@foxlearn 4 года назад
Let me try to research. but i think you should write an extension for your browser to help you capture download link
@BrandaGame
@BrandaGame 4 года назад
@@foxlearn Any update on that - I'm kinda interested in the same thing :)
@dineshrana87
@dineshrana87 3 года назад
How to use same progress in asp.net web application
@AbdouNetful
@AbdouNetful 8 лет назад
also i try it and it doesn't show me "download complated" . and nothing in the directory. :(
@foxlearn
@foxlearn 8 лет назад
+Abdelwaheb AMMAR Hi, Please check your code again. You can play the demo with URL: foxlearn.com/FileZilla.exe . Thanks
@waelluay6902
@waelluay6902 8 лет назад
really useful thank you
@foxlearn
@foxlearn 8 лет назад
+Wael Al-ameen Thanks a lot :D
@waelluay6902
@waelluay6902 8 лет назад
+Fox Learn it doesn't show me "download completed" and there's no file in the directory ?? it is the same code
@foxlearn
@foxlearn 8 лет назад
+Wael Al-ameen Hi, Please check in the debug folder, check your code again. Thanks
@usif904
@usif904 7 лет назад
can you send me the code for the download please?
@Zoen12345
@Zoen12345 3 года назад
i cant use if doing setup project.....
@diogenessantos6311
@diogenessantos6311 7 лет назад
the program can not save the file inside the same projects folder Why, for the end user, it becomes a disappointment
@foxlearn
@foxlearn 7 лет назад
Hi, Please check your code again. Make sure it's correct . thanks
@diogenessantos6311
@diogenessantos6311 7 лет назад
Fox Learn ,,Okay, I'll check Anything,I say to you
@justinwheetley
@justinwheetley 5 лет назад
What if you are downloading a file from a web page and all you have is the HTML ID or class, and the download link is created dynamically when you invoke the button click event? How would you download it in that scenario, and you aren't even saying where the file is going. Can you make this video more thorough please?
@foxlearn
@foxlearn 5 лет назад
You should find the file link that you want to download in html page, then you can download
@karraralhashimi1277
@karraralhashimi1277 5 лет назад
how can i download video from youtube in c#
@foxlearn
@foxlearn 5 лет назад
You can use youtube api. thank you !
@AbdouNetful
@AbdouNetful 8 лет назад
hello everyone, my question on this statement I do not understand that meant? here is my statement that I find on video of Tutorial - How to Download a File from Internet. lblStatus.text=$"Downloaded {String.Format("{0:0.##}",percentage)}%"; In this statement I do not understand the usefulness of using $? in addition it opens the quote in "Downloaded and closed it in }%"? is that possible to do like this? !!!
@foxlearn
@foxlearn 8 лет назад
+Abdelwaheb AMMAR Hi, $"Downloaded {String.Format("{0:0.##}",percentage)}%"; using in C# 6.0. You can write lblStatus.text = "Downloaded " + String.Format("{0:0.##} %",percentage); Thanks
@user-mm5ib6wn7m
@user-mm5ib6wn7m 7 лет назад
please give me this video source code and "How to Upload files with FTP " video's code?? i will apreciate it. i need your help!!
@diogenessantos6311
@diogenessantos6311 7 лет назад
fiz aqui e não tá baixando o arquivo não
@foxlearn
@foxlearn 7 лет назад
Hi, What error are you getting? thanks
@ShadeLV
@ShadeLV 7 лет назад
Can you put code in description?
@umairjibran7
@umairjibran7 4 года назад
foxlearn.com/articles/how-to-download-a-file-from-internet-in-csharp-230.html
@alemdervisevic4722
@alemdervisevic4722 4 года назад
Prograess bar and labele not working all is empty
@deawanhoqueayon8435
@deawanhoqueayon8435 7 лет назад
can i have the code please dear???
@foxlearn
@foxlearn 7 лет назад
Hi, What's your email? thanks
@foxlearn
@foxlearn 7 лет назад
Sent. Please check your email. Thank you
@kylewarren8393
@kylewarren8393 3 года назад
I know why for some people it just says download complete and shows no progress its because the image link is 0 bytes hence the no progress being shown. Use this link instead and see what happens: img1.wikia.nocookie.net/__cb20101219155130/uncyclopedia/images/7/70/Facebooklogin.png
@foxlearn
@foxlearn 3 года назад
Thank you so much !
@congtuan1203
@congtuan1203 7 лет назад
Download multiple files showing all on 1 prosessbar total
@foxlearn
@foxlearn 7 лет назад
OK. Thank you for your suggestion. I'll update soon
@alipanahi354
@alipanahi354 5 лет назад
cancel button or pause button pls 😣
@foxlearn
@foxlearn 5 лет назад
OK. Thank you for your suggestion !
@conceptfactory5604
@conceptfactory5604 2 года назад
TotalBytesToReceive always returning -1
@anshuvishwakarma6020
@anshuvishwakarma6020 5 лет назад
Not working
@foxlearn
@foxlearn 5 лет назад
What error are you getting?
@anshuvishwakarma6020
@anshuvishwakarma6020 5 лет назад
@@foxlearn give me your email I'd I send you screenshots
Далее
Украшаю чехлы 🎀
00:51
Просмотров 228 тыс.
c# Download File in c sharp with progressBar
9:13
Просмотров 1,3 тыс.