The title probably tells it all.
I'm a VB6 going to C# and trying to take a task I can do easily in VB6 and do it in C#.NET. I can really use some help and any pointers you can share.
Below is the code I've created so far to the job. Attached is the binary file in question so you can proof it for yourself.
Form has a multline textbox and a button event.
[code=c#]
private void button1_Click(o bject sender, EventArgs e)
{
var openFileDialog = new OpenFileDialog( );
if (openFileDialog .ShowDialog() == DialogResult.OK )
{
string filepath = openFileDialog. FileName;
// Open the file using the OpenFile method
var bufferedStream = new BufferedStream(
openFileDialog. OpenFile());
Byte[] bytes = new Byte[68];
//the line below didn't work and so its commented out...
//but I don't know why it didn't...
//heroText = bufferedStream. Read(bytes, 16, 11)
string heroText = Convert.ToBase6 4String(bytes);
textBox1.Text = heroText;
}
}
[/code]
Note: Ultimately, I am looking to just extract an exact set of characters in the dat file which happen to be hero names. You'll see them easily if you open the attached file in binary.
(Yep, its an OLD game file. Online Baked Cookie goes to who guesses it first and helps me with the solution. :) )
I'm a VB6 going to C# and trying to take a task I can do easily in VB6 and do it in C#.NET. I can really use some help and any pointers you can share.
Below is the code I've created so far to the job. Attached is the binary file in question so you can proof it for yourself.
Form has a multline textbox and a button event.
[code=c#]
private void button1_Click(o bject sender, EventArgs e)
{
var openFileDialog = new OpenFileDialog( );
if (openFileDialog .ShowDialog() == DialogResult.OK )
{
string filepath = openFileDialog. FileName;
// Open the file using the OpenFile method
var bufferedStream = new BufferedStream(
openFileDialog. OpenFile());
Byte[] bytes = new Byte[68];
//the line below didn't work and so its commented out...
//but I don't know why it didn't...
//heroText = bufferedStream. Read(bytes, 16, 11)
string heroText = Convert.ToBase6 4String(bytes);
textBox1.Text = heroText;
}
}
[/code]
Note: Ultimately, I am looking to just extract an exact set of characters in the dat file which happen to be hero names. You'll see them easily if you open the attached file in binary.
(Yep, its an OLD game file. Online Baked Cookie goes to who guesses it first and helps me with the solution. :) )
Comment