This project has moved. For the latest updates, please go here.

Visual Basic Samples

The samples here are provided in VisualBasic.NET. C# users are generally always able to read VB except in the most advanced cases. Apart from obvious like needing semicolons added, method calls and member access for example are very similar, and explicit Sub…End Sub, While … End While can simply be replaced by braces {…}. For the samples here the only thing that might need to be explained is that “Dim” creates a variable definition, so the first two lines in the first OBEX sample in VB and C# are:

Dim addr As String = "112233445566"
Dim uri As New Uri("obex://" & addr & "/HelloWorld.txt") 


String addr = "112233445566";
Uri uri = new Uri("obex://" + addr + "/HelloWorld.txt"); 

So apart from the change to the variable definition syntax we needed to add a semicolon to end of each line, change the case of keyword “New” to be “new”, and change VB’s string append operator (&) to C#s ‘+’ equivalent.

Last edited Dec 10, 2010 at 3:21 PM by alanjmcf, version 2


No comments yet.