Converting VB .NET code to C#

Posted by Brono The Vibrator on Stack Overflow See other posts from Stack Overflow or by Brono The Vibrator
Published on 2010-05-10T16:01:32Z Indexed on 2010/05/10 16:04 UTC
Read the original article Hit count: 324

Filed under:

I have the follwing VB .NET code I am trying to convert to C#

Dim decryptedBytes(CInt(encryptedStream.Length - 1)) As Byte

I tried this:

int tempData = Convert.ToInt32(encryptedStream.Length - 1);
Byte decryptedBytes;
decryptedBytes = decryptedBytes[tempData];

but got this error message: Cannot apply indexing with [] to an expression of type byte.

Please note that the VB .NET code works.

© Stack Overflow or respective owner

Related posts about vb.net-to-c#