C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » C# Syntax »

C#:Cross Language Assembly Implementation


Posted Date: 01 Nov 2008    Resource Type: Code Snippets    Category: C# Syntax
Author: Gaurav AroraMember Level: Diamond    
Rating: 1 out of 5Points: 15



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



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
C#:Cross Language Assembly Implementation  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C#Using Private Assembly
Previous Resource: String comparison
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use