private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { Stream stream = File.OpenRead(filePath); try { foreach (long offset in Researcher.FindPosition(stream, 0, offset1, blabla2)) { stream.Close(); BinaryWriter binaryWriter = new BinaryWriter(File.Open(filePath, FileMode.Open, FileAccess.ReadWrite)); binaryWriter.Write(blabla2); binaryWriter.Close(); ThreadHelperClass.SetText(this, richTextBox1, "Skin Sucfully Reverted!"); MessageBox.Show("Done!"); } } finally { } }