' This Example is a part of different ' examples shown in Book: ' C#2005 Beginners: A Step Ahead' Written by: Gaurav Arora ' Reach at : msdotnetheavenREM File name : vbClass.vbNamespace 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 ClassEnd Namespace
/* 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(); } }}