Converting a C# code to Vb 8 express (HELP)

Discussion in 'Programming & Scripting' started by semperfi2026, Jun 29, 2009 with 4 replies and 281 views.

  1. semperfi2026

    semperfi2026 Enthusiast

    Messages:
    88
    Ratings:
    9
    How would i convert this code from C# to Vb express? could someone that is experienced with both of them plz tell me how to code it for vb express, (btw im makin a map resigner for halo2) Code:


    int size=map.filesize-2048;
    int times=size/4;
    int result=0;
    int x;
    FileStream FS=new FileStream(openmap.FileName,FileMode.Open ,FileAccess.ReadWrite,FileShare.ReadWrite);
    BinaryReader BR=new BinaryReader(FS);
    BinaryWriter BW=new BinaryWriter(FS);
    BR.BaseStream.Seek(2048,
    SeekOrigin.Begin);
    for (x=0;x<times;x++)
    {
    result=result^BR.ReadInt32();
    }
    BW.BaseStream.Seek(720,
    SeekOrigin.Begin);
    BW.Write(result);
    BR.Close();
    FS.Close();
    mapstuff.sig.Text=result.ToString(
    "X");
    MessageBox.Show("Done");



    I don think it will be hard, Thank You
     
  2. SSM

    SSM Enthusiast

    Messages:
    437
    Ratings:
    122
    Code:
    Dim size As Integer = map.filesize - 2048
    Dim times As Integer = size / 4
    Dim result As Integer = 0
    Dim x As Integer
    Dim FS As FileStream = newFileStream(openmap.FileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
    Dim BR As BinaryReader = newBinaryReader(FS)
    Dim BW As BinaryWriter = newBinaryWriter(FS)
    BR.BaseStream.Seek(2048, SeekOrigin.Begin)
    For x = 0 To times - 1
    * * result = result Xor BR.ReadInt32()
    Next
    BW.BaseStream.Seek(720, SeekOrigin.Begin)
    BW.Write(result)
    BR.Close()
    FS.Close()
    mapstuff.sig.Text = result.ToString("X")
    MessageBox.Show("Done")
    Hey bro, please say thanks :smile:
     
    • Like Like x 1
  3. Ibdc

    Ibdc Retired Retired

    Messages:
    5,100
    Ratings:
    2,072
  4. SSM

    SSM Enthusiast

    Messages:
    437
    Ratings:
    122
  5. OP
    semperfi2026

    semperfi2026 Enthusiast

    Messages:
    88
    Ratings:
    9

Share This Page