dotnetspider.com


 


TutorialsForumResourcesReviewsJobsInterviewVideosCommunitiesProjectsTraining

Subscribe to Subscribers


Online MembersSankar
Sunitha
Ashokkumar
Anu George
chanti
Falguni
Prachi Kulkarni
cloud
Prasad kulkarni
More...




Resources » Code Snippets » C# Syntax


C#:Cross Language Assembly Implementation


Posted Date:     Category: C# Syntax    Rating: 1 out of 5
Author: Member Level: Gold    Points: 15 (Rs 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


Did you like this resource? Share it with your friends and show your love!





Responses to "C#:Cross Language Assembly Implementation"

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

Feedbacks      

Post 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:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: C#Using Private Assembly
    Previous Resource: String comparison
    Return to Resources
    Post New Resource
    Category: C# Syntax


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    (No tags found.)

    My Profile

    Active Members
    TodayLast 7 Daysmore...


    Awards & Gifts


    Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds



    About Us    Trademark Disclaimer    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.