Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Place If statement on an executable control (Button, label, image, etc.)
- if (openFileDialog1.ShowDialog() == DialogResult.OK)
- {
- FileName = openFileDialog1.FileName;
- Reader = new BinaryReader(File.Open(openFileDialog1.FileName, FileMode.Open));
- ReadFile();
- }
- void ReadFile()
- {
- String Magic = Encoding.ASCII.GetString(Reader.ReadBytes(4));
- if (Magic != "XDBF")
- {
- MessageBox.Show("File isn't a valid GPD.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment