Jump to content

cbox


Recommended Posts

Posted

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.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...