C#:Cross Language Assembly Implementation

C#:Cross Language Assembly Implementation


Introduction:


This is a continuation to my earlier post C#-The Language : A Step Ahead Series-Part-II
In the available example you have to create another .net language application lets say here you will create a Visual BAsic.NET class application.
Following we have two code snippet one is showing Cross Language Assembly while another implementing the same:

The following is the VB.Net code(s):


' This Example is a part of different
' examples shown in Book:
' C#2005 Beginners: A Step Ahead
' Written by: Gaurav Arora
' Reach at : msdotnetheaven

REM File name : vbClass.vb
Namespace CSharp.AStepAhead.crossLanguageAssembly
Public Class vbClass
Protected X, Y As Integer

Public Sub New(ByVal U As Integer, ByVal V As Integer)
X = U
Y = V
End Sub
Public Overrides Function ToString() As String
Return "Entered Numbers are : " & X.ToString() & " , " & Y.ToString()
End Function
End Class
End Namespace


Another is the C# code(s):


/* This Example is a part of different
* examples shown in Book:
* C#2005 Beginners: A Step Ahead
* Written by: Gaurav Arora
* Reach at : msdotnetheaven*/

using System;
using System.Collections.Generic;
using System.Text;
using crossLanguageAssembly.CSharp.AStepAhead.crossLanguageAssembly;

namespace CSharp.AStepAhead.crossLanguageClientApplication
{
class crossLanguageClientClass
{
static void Main(string[] args)
{
Console.Clear();
Console.Write("\n Enter First Number : ");
int num1 = int.Parse(Console.ReadLine());
Console.Write("\n Enter Second Number : ");
int num2 = int.Parse(Console.ReadLine());

vbClass myObj = new vbClass(num1, num2);
Console.WriteLine("\n Result : " + myObj.ToString());
Console.ReadLine();
}
}

}


Steps: how to use


Please refer to tutorial [earlier posts]:
1. C#-The Language : A Step Ahead Series-Part-I
2. C#-The Language : A Step Ahead Series-Part-II


Article by Gaurav Aroraa
Gaurav is a Microsoft Technology Specialist professional. He has awarded lifetime membership from Computer Society of India (CSI). He has more than 13yrs of experience in the industry. Currently, he is working in the capacity of Solution Architect with an MNC. He is serving to the various communities since 1999.

Follow Gaurav Aroraa or read 157 articles authored by Gaurav Aroraa

Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: