skip navigation
Game Plague Forums
Not a member? ( Register )
User Name: Password:
C# example for overwriting a file
Pages: [1] -
This user has donated to Pycosupersniper
12/11/10 05:00 pm - Last edited 12/11/10 05:01 pm by supersniperFilter

Guild Member


Awards:

Group: Member
Posts: 757
Donor: This user has donated to Pyco
QUOTE:
private void overwrite(object sender, EventArgs e) { if ((textBox1.Text != string.Empty) && (MyFilename != string.Empty)) { File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\My Games\Halo 2\Maps\" + MyFilename); { File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\My Games\Halo 2\Maps\" + MyFilename); } File.Move(textBox1.Text, Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\My Games\Halo 2\Maps\" + MyFilename); MessageBox.Show("The Halo 2 Vista map " + MyFilename.Split(new char[] { '.' })[0] + ".map was successfully moved to\nyour Halo 2 Vista custom maps folder.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); textBox1.Text = ""; MyFilename = ""; } else { MessageBox.Show("Please select a Halo 2 Vista map file first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
in case people are wondering. it's a simple process really. sorry its in halo 2 vista that's basically my coding place lol

------------
PT SERVER: USA (Central) - ss: Offline Image
Dark Matter
12/11/10 07:16 pmFilter - Reply #1

Champion


Awards:

Group: Member
Posts: 4563
What point does this have?

------------
Want to know when a pokemon evolves or what moves it learns? Having trouble uncovering hidden items? Visit the Official Pokemon Twilight Guide! Got any questions about PT or the forums? Visit the FAQ!
Official Beta Tester for Pokemon Twilight Highest poster on the GFF Most active member on the GFF 66 (+2 special) out of 66 Pokemon Obtained on PTV5! Every single one of 'em! Image
Pages: [1] -