请问关于c的具体应用场景有哪些?
- 内容介绍
- 文章标签
- 相关推荐
本文共计345个文字,预计阅读时间需要2分钟。
参考链接:[https://www.cnblogs.com/taiyonghai/p/5604159.](https://www.cnblogs.com/taiyonghai/p/5604159.)
类别:***
java
1.using System;
2.using System.Collections.Generic;
参考链接:www.cnblogs.com/taiyonghai/p/5604159.html
类:
/************************************************************************************************************************/
1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Net; 6 using System.Text; 7 using System.Windows.Forms; 8 using System.Threading.Tasks; 9 using System.Threading; 10 11 namespace speedtest.dallas.linode.com/100MB-dallas.bin"; //下载地址 18 19 static string temp = System.Environment.GetEnvironmentVariable("TEMP"); 20 static string loadFilefolder = new System.IO.DirectoryInfo(temp).FullName + @"\" + "100MB-dallas.bin"; 21 22 Thread td; 23 HttpHelper httpManager = new HttpHelper(url, loadFilefolder); 24 25 public Form1() 26 { 27 InitializeComponent(); 28 } 29 30 private void Form1_Load(object sender, EventArgs e) 31 { 32 httpManager.timer = new System.Windows.Forms.Timer(); 33 httpManager.processShow += processSho; 34 httpManager.processCompleted += processComplete; 35 httpManager.init(); 36 37 } 38 39 public void processSho(string totalNum, string num, int proc, string speed, string remainTime, string msg) 40 { 41 this.label1.Text = string.Format("文件大小:{0}", totalNum); 42 this.label2.Text = string.Format("已下载:{0}", num); 43 this.label3.Text = string.Format("进度:{0}%", proc); 44 this.label4.Text = msg; 45 this.label5.Text = string.Format("速度:{0}",speed); 46 this.label6.Text = string.Format("剩余时间:{0}",remainTime); 47 } 48 49 private void processComplete() 50 { 51 MessageBox.Show("文件下载完成!", "提示"); 52 } 53 54 private void button1_Click(object sender, EventArgs e) 55 { 56 httpManager.DownLoadStart(); 57 58 } 59 60 private void button2_Click(object sender, EventArgs e) 61 { 62 httpManager.DownLoadPause(); 63 } 64 65 private void button3_Click(object sender, EventArgs e) 66 { 67 httpManager.DownLoadContinue(); 68 } 69 } 70 }
效果
/*********************************************************************************/
本文共计345个文字,预计阅读时间需要2分钟。
参考链接:[https://www.cnblogs.com/taiyonghai/p/5604159.](https://www.cnblogs.com/taiyonghai/p/5604159.)
类别:***
java
1.using System;
2.using System.Collections.Generic;
参考链接:www.cnblogs.com/taiyonghai/p/5604159.html
类:
/************************************************************************************************************************/
1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Net; 6 using System.Text; 7 using System.Windows.Forms; 8 using System.Threading.Tasks; 9 using System.Threading; 10 11 namespace speedtest.dallas.linode.com/100MB-dallas.bin"; //下载地址 18 19 static string temp = System.Environment.GetEnvironmentVariable("TEMP"); 20 static string loadFilefolder = new System.IO.DirectoryInfo(temp).FullName + @"\" + "100MB-dallas.bin"; 21 22 Thread td; 23 HttpHelper httpManager = new HttpHelper(url, loadFilefolder); 24 25 public Form1() 26 { 27 InitializeComponent(); 28 } 29 30 private void Form1_Load(object sender, EventArgs e) 31 { 32 httpManager.timer = new System.Windows.Forms.Timer(); 33 httpManager.processShow += processSho; 34 httpManager.processCompleted += processComplete; 35 httpManager.init(); 36 37 } 38 39 public void processSho(string totalNum, string num, int proc, string speed, string remainTime, string msg) 40 { 41 this.label1.Text = string.Format("文件大小:{0}", totalNum); 42 this.label2.Text = string.Format("已下载:{0}", num); 43 this.label3.Text = string.Format("进度:{0}%", proc); 44 this.label4.Text = msg; 45 this.label5.Text = string.Format("速度:{0}",speed); 46 this.label6.Text = string.Format("剩余时间:{0}",remainTime); 47 } 48 49 private void processComplete() 50 { 51 MessageBox.Show("文件下载完成!", "提示"); 52 } 53 54 private void button1_Click(object sender, EventArgs e) 55 { 56 httpManager.DownLoadStart(); 57 58 } 59 60 private void button2_Click(object sender, EventArgs e) 61 { 62 httpManager.DownLoadPause(); 63 } 64 65 private void button3_Click(object sender, EventArgs e) 66 { 67 httpManager.DownLoadContinue(); 68 } 69 } 70 }
效果
/*********************************************************************************/

