CSharp.Net-Informations.com

  C# and VB.NET




   Categories

    HOME
    VB.NET
    CSHARP


   














C# and VB.NET

CSharp and VB.NET are the two primary languages used to program on the .NET Framework environment. Both languages are use the same framework and they both precompiled into the same byte code and then it is compiled and run at runtime. So we can say VB.NET and C# are functionally equivalent. Both C# and Visual Basic.NET share structural similarities with other modern high level languages such as Java and C++ .

But both have different in many features. Primarily keywords are different in each other language . C# is case sensitive while Visual Basic .NET is not. In VB.NET "Example" and "example" are same , but in CSHARP "Example" and "example" are two different variable names. Also it is good to remember that C# statements always terminated by a semicolon (;).

The following are some examples of differences between VB.NET and C#.

Single Line Comments :

  VB.NET	: ' ex: 'This is a single line comment

CSHARP : // ex: //This is a single line comment

Multi Line Comments :

  VB.NET	: Not available

CSHARP : /*..*/ ex: /*Multi line comments */

Conditional Statements

VB.NET

  If condition Then
	  'vb.net code
  Else
	  'vb.net code

End If

CSHARP

  if(condition)
  {
	  //csharp code
  }
  else
  {
	  //csharp code

}

Loops

VB.NET

  For counter As Integer = 0 To final
	  'vb.net code

Next

CSHARP

  for(int i=0;i < final;i++)
  {
	  //csharp code

}

Operator (Equal)

VB.NET

  a=b

CSHARP

  a==b;

Declaration

VB.NET

  Dim i as Integer = 10

CSHARP

  int i=10;

Click the following link to learn more about VB.NET and C# Keywords differences

CSharp VB.Net comparison


        
        
C# Tutorial


CSharp overview Related Contents
*     An overview of Microsoft .Net Framework
*     An introduction to C#
*     C# and JAVA
*     C# sample programs
*     C# console based application
*     C# windows based application
*     C# command line tools
*     C# command line arguments

CSharp Related Topics
*     An overview of Microsoft CSharp
*     C# Language Tutorial
*     C# Statements Tutorial
*     C# Collection Tutorial
*     C# String Tutorial
*     C# File Operations Tutorial
*     C# Excel Tutorial
*     C# Crystal Reports Tutorial
*     CSharp Communication Tutorial
*     C# Ado.Net Tutorial and Source Code
*     C# ADO.NET data Providers Tutorial
*     C# Dataset Tutorial
*     C# DataAdapater Tutorial
*     Csharp DataView Tutorial
*     Csharp Remoting Tutorial
*     C# XML Tutorial
Search here for more CSharp Source Code :

  |  Home   |  SiteMap   |  About   |
net-informations.com (C) 2010 All Rights Reserved