public void Start(string url, string filePath) { Url = url; var uri = new Uri(url); var segs = uri.Segments.ToList(); segs.RemoveAt(0); StreamName = segs.Last(); segs.Remove(StreamName); AppName = string.Join("", segs); TcUrl = url.Remove(url.LastIndexOf(StreamName)); StreamName = StreamName.TrimStart('/'); FilePath = filePath; Session = DownloadSession = new DownloadSession(this); var app = new BaseClientApplication(Variant.GetMap(new VariantMapHelper { { Defines.CONF_APPLICATION_NAME, AppName } })) { Id = 1 }; Application = app; DownloadSession.Connect(url); Status = "正在连接"; StartTime = DateTime.Now; OnPropertyChanged(nameof(TimeSpent)); }
public void Restart() { this.RegisterProtocol(); var udpProtocol = new UDPProtocol { NearProtocol = this }; UDPCarrier.Create("", 0, this); Session = DownloadSession = new DownloadSession(this); DownloadSession.Connect(Url); Status = "正在连接"; StartTime = DateTime.Now; OnPropertyChanged(nameof(TimeSpent)); }
public void Start(string url,string filePath) { Url = url; var uri = new Uri(url); var segs = uri.Segments.ToList(); segs.RemoveAt(0); StreamName = segs.Last(); segs.Remove(StreamName); AppName = string.Join("", segs); TcUrl = url.Remove(url.LastIndexOf(StreamName)); StreamName = StreamName.TrimStart('/'); FilePath = filePath; Session = DownloadSession = new DownloadSession(this); var app = new BaseClientApplication(Variant.GetMap(new VariantMapHelper { {Defines.CONF_APPLICATION_NAME, AppName} })) {Id = 1}; Application = app; DownloadSession.Connect(url); Status = "正在连接"; StartTime = DateTime.Now; OnPropertyChanged(nameof(TimeSpent)); }