Search Result

Collapse
2 results in 0.0030 seconds.
Keywords
Members
Tags
char byte
  •  

  • John Smith
    Guest started a topic Convert Byte to Char

    Convert Byte to Char

    Hello,

    Suppose I have the following C# code which I want to convert to VB:

    for (int i = 0; i < nFieldLength; i++)
    Console.Write(( char) sValue[i]);

    sValue is a byte [] array.

    The problem is the typecast which I can't find an equivalent for in VB. I
    tried using CChar() and CType() but neither of them seemed to work. Instead
    the compiler said it can't convert Byte to Char.
    ...
    See more | Go to post

  • Petar Popara
    Guest started a topic char[] to byte[]

    char[] to byte[]

    I have this case:

    int bufferLen = Convert.ToInt32 (file.Length);
    char[] buffer = new char[bufferLen];
    int len = sr.Read(buffer, 0, bufferLen);
    rawBytes.setByt esArray(buffer) ;

    While executing above code I got this (COM, automation) error at last line:

    An unhandled exception of type
    'System.Runtime .InteropService s.SafeArrayType MismatchExcepti on' occurred in
    MyApp.exe

    That...
    See more | Go to post
Working...