Salut,

Voilà, je suis plutôt orienté VB .net, mais j'ai un bout de code en C# qui m'intéresse, enfin, une routine plus générale que je veux traduire en VB. Les outils que j'ai trouvé n'arrive pas à le faire.

Est-ce que vous pouve m'expliquer ce que font ces lignes ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
        public unsafe void ReadTwoInts(out int FourCC, out int size)
        {
            try {
                int readsize = m_stream.Read(m_eightBytes, 0, TWODWORDSSIZE);
 
                if (TWODWORDSSIZE != readsize) {
                    throw new RiffParserException("Unable to read. Corrupt RIFF file " + FileName);
                }
 
                fixed (byte* bp = &m_eightBytes[0]) {
                    FourCC = *((int*)bp);
                    size = *((int*)(bp + DWORDSIZE));
                }
            }
            catch (Exception ex)
            {
                throw new RiffParserException("Problem accessing RIFF file " + FileName, ex);
            }
        }
Et celles-ci :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
        public unsafe void ReadOneInt(out int FourCC)
        {
            try {
                int readsize = m_stream.Read(m_fourBytes, 0, DWORDSIZE);
 
                if (DWORDSIZE != readsize) {
                    throw new RiffParserException("Unable to read. Corrupt RIFF file " + FileName);
                }
 
                fixed (byte* bp = &m_fourBytes[0]) {
                    FourCC = *((int*)bp);
                }
            }
            catch (Exception ex)
            {
                throw new RiffParserException("Problem accessing RIFF file " + FileName, ex);
            }
        }
Ou bien, y'aurait-il quelqu'un qui pourrait me traduire en VB ?

Merci par avance.