How to download files from videohelp with c#?

foozoor

Newbie
Joined
Nov 16, 2014
Messages
12
Reaction score
0
How can I download file from videohelp with c# language?

Sometimes it works well with only the WebClient.DownloadFile method.
But not always because there are cookie and maybe referer protections.
 
Use WebClient.DownloadData() and parse the response. Correct the request as necessary. Not sure why you want to use synchronous methods though, or why you're not using the new HttpClient class.
 
Last edited:
Correct the request as necessary.

How to do that, I don't understand anything about cookies.
Moreover, sometimes I can download files directly without anything else.

Damn, there so many http clients in the c# world now:

- Flurl
- HttpClient
- HttpWebRequest
- RestSharp
- WebClient
 
What response do you get that is out of the norm? Figure that out. If you can't then you won't understand how to fix your problem anyways because it's the basics...

Furthermore, I don't think you really understand what is what in terms of web request wrappers in the .NET BCL. A WebClient is hardly any different from HttpWebRequest's, and 2 of the other items you posted are NOT even part of the standard .NET framework but rather 3rd party libraries...
 
I finally have something that works!
But I was obliged to add .Result after each asynchronous method, which as a result, are no longer asynchronous.
As I still can not insert url so I hosted the code on pastebin: pastebin[dot]com[slash]M3cFLpJQ
 
You aren't obliged to do anything, you just don't understand how to properly make use of those asynchronous functions... The whole point is not to call Result directly from the caller and especially immediately too like that.
 
Back
Top