mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fix for #1094 - thx xylographe :)
This commit is contained in:
parent
8223d60dc4
commit
57f090ac9d
@ -297,13 +297,15 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
/// Downloads the requested resource as a <see cref="String"/> using the configured <see cref="WebProxy"/>.
|
||||
/// </summary>
|
||||
/// <param name="address">A <see cref="String"/> containing the URI to download.</param>
|
||||
/// <param name="encoding">Encoding for source text</param>
|
||||
/// <returns>A <see cref="String"/> containing the requested resource.</returns>
|
||||
public static string DownloadString(string address, Encoding encoding = null)
|
||||
{
|
||||
using (var wc = new WebClient())
|
||||
{
|
||||
wc.Proxy = GetProxy();
|
||||
wc.Encoding = encoding ?? encoding;
|
||||
if (encoding != null)
|
||||
wc.Encoding = encoding;
|
||||
return wc.DownloadString(address).Trim();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user