Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace test
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- backgroundWorker1.WorkerReportsProgress = true;
- backgroundWorker1.RunWorkerAsync();
- }
- private void backgroundWorker1_DoWork_1(object sender, DoWorkEventArgs e)
- {
- for (int i = 1; i <= 100; i++)
- {
- Console.WriteLine("schella");
- backgroundWorker1.ReportProgress(i, "3878/939");
- }
- }
- private void backgroundWorker1_ProgressChanged_1(object sender, ProgressChangedEventArgs e)
- {
- progressBar1.Value = e.ProgressPercentage;
- // Set the text.
- this.Text = e.ProgressPercentage.ToString();
- string variable1 = e.UserState.ToString().Substring(0, e.UserState.ToString().IndexOf('/'));
- string variable2 = e.UserState.ToString().Substring(e.UserState.ToString().LastIndexOf('/') + 1);
- MessageBox.Show(variable1);
- MessageBox.Show(variable2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement