using System; using System.Collections.Generic; using System.Text; using System.IO; namespace AutoUpdater { public class DownloadURL { private string url = string.Empty; private string dest = string.Empty; public long Size { get; set; } public DownloadURL(string url) { this.url = url; } public DownloadURL(string url, string dest) { this.url = url; this.dest = dest; } public DownloadURL() { } public string URL { get { return Uri.UnescapeDataString(url); //return System.Net.WebUtility.UrlDecode(url, System.Text.Encoding.GetEncoding("GB2312")); } } public string Destination { get { if (Path.GetFileName(dest) == string.Empty || Directory.Exists(dest)) { Uri uri = new Uri(url); dest = Path.Combine(dest, uri.Segments[uri.Segments.Length - 1].ToString()); } return dest; } set { dest = value; } } } }