Results 1 to 3 of 3

Thread: [RESOLVED] Help.. Single Byte to String....

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2004
    Posts
    95

    [RESOLVED] Help.. Single Byte to String....

    I'm trying to find the equivalent of this C# function in VB.NET.

    Code:
    		public static object bdecode_rec(byte[] x, ref int f)
    		{
    			byte t = x[f];
    
    			if (t == 'i')
    			{
    				f += 1;
    				return decode_int(x, ref f);
    			}


    VB Code:
    1. Public Shared Function bdecode_rec(ByVal x() As Byte, ByRef f As Integer) As Object
    2.  
    3.         Dim t As Byte = x(f)
    4.        'Byte t's value is 100.
    5.  
    6.         If System.Convert.ToString(t) = "i" Then
    7.         'Above does not work.
    8.  
    9.             f += 1
    10.  
    11.             Return decode_int(x, f)

    Obviously I ommitted a lot of code here, but that's not important.

    How can I get the string representation of a single byte?

    EDIT: Resolved.

    Chr(t) returned "d" as a string, the character represented by the value 100 assigned to byte t.
    Last edited by Kt3; Apr 29th, 2004 at 01:11 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width