private void ShowCurrentDownloadFileName(string name) { if (this.labelCurrentItem.InvokeRequired) { ShowCurrentDownloadFileNameCallBack cb = new ShowCurrentDownloadFileNameCallBack(ShowCurrentDownloadFileName); this.Invoke(cb, new object[] { name }); } else { this.labelCurrentItem.Text = name; } }
/// <summary> /// 显示正在下载的文件 /// </summary> /// <param name="name"></param> private void ShowCurrentDownloadFileName(string name, long size) { if (this.lblFileName.InvokeRequired) { ShowCurrentDownloadFileNameCallBack cb = new ShowCurrentDownloadFileNameCallBack(ShowCurrentDownloadFileName); this.Invoke(cb, new object[] { name, size }); } else { this.lblFileName.Text = $"文件信息:{name}({size / 1024}KB)"; } }
private void ShowCurrentDownloadFileName(string name) { if (labelCurrentItem.InvokeRequired) { ShowCurrentDownloadFileNameCallBack cb = ShowCurrentDownloadFileName; Invoke(cb, name); } else { labelCurrentItem.Text = name; } }