Who good C#?

Results 1 to 8 of 8
  1. #1
    Registered onedollar is offline
    MemberRank
    Sep 2013 Join Date
    5Posts

    note Who good C#?


    RaGEZONE Recommends

    RaGEZONE Recommends

    I want to write a small program to read a file, from offset 0xFB650 to offset 0xFB656 and show value in a text box.
    Who can help me?


  2. #2
    Ares Online killburne is offline
    True MemberRank
    Aug 2010 Join Date
    GermanyLocation
    413Posts

    Re: Who good C#?

    google can help you

  3. #3
    Registered onedollar is offline
    MemberRank
    Sep 2013 Join Date
    5Posts

    Re: Who good C#?

    I searched but don't work, can you give me an example?

  4. #4
    Guss decarvk is offline
    True MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    350Posts

    Re: Who good C#?

    How to read file binary in C#? - Stack Overflow

    all is here for binary reading for offset just ignore the offset first byte of the file.

  5. #5
    Member bergi9 is offline
    MemberRank
    Dec 2011 Join Date
    54Posts

    Re: Who good C#?

    BinaryReader bin = new BinaryReader();
    byte[] bytes = new bytes[0xFB656 - 0xFB650];
    bin.Read(bytes, 0xFB650, bytes.Length);

    i just made it from my head, i dont give guarantee that this works.
    Last edited by bergi9; 14-09-13 at 04:39 PM. Reason: no need for a loop

  6. #6
    Who good C#? Future is online now
    SupervisorRank
    Dec 2011 Join Date
    1,833Posts

    Re: Who good C#?

    my god let him have the research....
    He wont learn it just by copy and paste code lines, you write to him.

    Also, I think what he needs, is the Seek method of the FileStream Class in combination with some methods of the BinaryReader Class...




    Quote Originally Posted by A Wise Man
    P-Servers are NOT dead. Bugs need squishing. Quests need fixing. Unfortunately, majority of people don't know the difference between a computer and a toaster so...

  7. #7
    Ultimate Member ttlove9 is offline
    MemberRank
    Dec 2012 Join Date
    Hải Dương (Location
    161Posts

    Re: Who good C#?

    Code:
          private void Form1_Load(object sender, EventArgs e)
            {
                string path = @"C:\test.bin";
                using (FileStream fs = File.OpenRead(path))
                {
                    byte[] b = new byte[6];
                    UTF8Encoding temp = new UTF8Encoding(true);
                    fs.Position = 0xFB650;
                    fs.Read(b, 0, b.Length);               
                    textBox1.Text = temp.GetString(b);
                    fs.Close();   
                }
                
            }

    AceOnline is my life

  8. #8
    Registered onedollar is offline
    MemberRank
    Sep 2013 Join Date
    5Posts

    Re: Who good C#?

    good work, thanks for your help!




Advertisement