yungbol Posted December 30, 2008 Report Posted December 30, 2008 I am trying to make an app and Goldbl4d3 helped me out so far, but all I need is a few more pieces of code and I hope someone will help. I have a BinaryReader that reads strings. It takes far too long to read from a big file so I want it to stay within 2 offsets. (0x10000 and 0x20000) What type of code can I add to do that. So far I have this: private void button2_Click(object sender, EventArgs e) { base.Enabled = false; listView1.Items.Clear(); string search = comboBox1.Text; BinaryReader br = new BinaryReader(new FileStream(fileLocation, FileMode.Open, FileAccess.Read)); for (int i = 0; i < (int)br.BaseStream.Length; i++) { if ((br.BaseStream.Length - br.BaseStream.Position) >= search.Length) { br.BaseStream.Position = i; string found = ""; try { found = new string(br.ReadChars(search.Length)); } catch { } if (found == search) { //No statement } } } ... Also it writes Binary as well.
Mcmodder♥ Posted December 31, 2008 Report Posted December 31, 2008 you should try a more efficient code mine would have worked As for this i havent read through it very thoroughly might answer when i next come back to site
yungbol Posted January 1, 2009 Author Report Posted January 1, 2009 Well I got the offsets working, not I just need to read 4 bytes after.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now