Click here to Skip to main content
15,891,316 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
Dave Kreskowiak5-Oct-04 12:25
mveDave Kreskowiak5-Oct-04 12:25 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman5-Oct-04 22:13
cwayman5-Oct-04 22:13 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman6-Oct-04 0:00
cwayman6-Oct-04 0:00 
GeneralRE: Automate code-writing in VB.NET control's development Pin
esalkin30-Sep-04 2:54
esalkin30-Sep-04 2:54 
Generalexception Pin
Fired Dragon30-Sep-04 2:45
Fired Dragon30-Sep-04 2:45 
GeneralRe: exception Pin
Syed Abdul Khader30-Sep-04 3:44
Syed Abdul Khader30-Sep-04 3:44 
GeneralRe: exception Pin
Fired Dragon30-Sep-04 12:27
Fired Dragon30-Sep-04 12:27 
GeneralConvert from C# Pin
LeeOvEngland30-Sep-04 2:23
LeeOvEngland30-Sep-04 2:23 
I have a function that I need to convert from C# to VB.

C#
public byte[] ConvertStreamToByteBuffer(System.IO.Stream theStream)
{
int b1;
System.IO.MemoryStream tempStream = new System.IO.MemoryStream();

while((b1=theStream.ReadByte())!=-1)
{
tempStream.WriteByte(((byte)b1));
}

return tempStream.ToArray();
}

My VB So far...
Public Function ConvertStreamToByteBuffer(ByVal theStream As System.IO.Stream) As Byte()
Dim b1 As Integer
Dim tempStream As New System.IO.MemoryStream

While ((b1 = theStream.ReadByte()) <> -1)
tempStream.WriteByte(((byte)b1))
End While

Return tempStream.ToArray()
End Function

i keep getting an error of: 'Byte' is a type, and so is not a valid expression. referring to the code in the while statement.

Please can someone help me to convert the function

Thank You
GeneralRe: Convert from C# Pin
The Man from U.N.C.L.E.30-Sep-04 3:25
The Man from U.N.C.L.E.30-Sep-04 3:25 
GeneralRe: Convert from C# Pin
Gavin Jeffrey30-Sep-04 3:41
Gavin Jeffrey30-Sep-04 3:41 
GeneralRe: Convert from C# Pin
The Man from U.N.C.L.E.30-Sep-04 7:05
The Man from U.N.C.L.E.30-Sep-04 7:05 
GeneralRe: Convert from C# Pin
Steven Campbell30-Sep-04 8:46
Steven Campbell30-Sep-04 8:46 
QuestionHow to display data from access to DataGrid in VB.Net using coding technique only Pin
Mekong River30-Sep-04 0:00
Mekong River30-Sep-04 0:00 
AnswerRe: How to display data from access to DataGrid in VB.Net using coding technique only Pin
Britnt730-Sep-04 5:43
Britnt730-Sep-04 5:43 
GeneralRe: How to display data from access to DataGrid in VB.Net using coding technique only Pin
Mekong River30-Sep-04 15:29
Mekong River30-Sep-04 15:29 
GeneralRe: How to display data from access to DataGrid in VB.Net using coding technique only Pin
Mekong River30-Sep-04 15:53
Mekong River30-Sep-04 15:53 
Generalweb class library Pin
njppp29-Sep-04 21:14
njppp29-Sep-04 21:14 
GeneralHelp with Secant/Newton's Method Program Pin
L_JIMENEZ29-Sep-04 15:34
L_JIMENEZ29-Sep-04 15:34 
GeneralRe: Help with Secant/Newton's Method Program Pin
Christian Graus29-Sep-04 16:51
protectorChristian Graus29-Sep-04 16:51 
Questionhow to .......... Pin
Fired Dragon29-Sep-04 12:13
Fired Dragon29-Sep-04 12:13 
AnswerRe: how to .......... Pin
Christian Graus29-Sep-04 12:24
protectorChristian Graus29-Sep-04 12:24 
GeneralRe: how to .......... Pin
Fired Dragon29-Sep-04 12:47
Fired Dragon29-Sep-04 12:47 
GeneralRe: how to .......... Pin
Christian Graus29-Sep-04 12:56
protectorChristian Graus29-Sep-04 12:56 
GeneralRe: how to ..........this is all what i have done, it may make you more visible Pin
Fired Dragon29-Sep-04 12:57
Fired Dragon29-Sep-04 12:57 
GeneralRe: how to ..........this is all what i have done, it may make you more visible Pin
Christian Graus29-Sep-04 13:10
protectorChristian Graus29-Sep-04 13:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.