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#Using Private Assembly


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



C#:Using Private Assembly


Introduction:


This is a continuation to my earlier posts :

1. C#-The-Language-A-Step-Ahead-Series-Part-I.aspx

2. C#:Creating Private Assembly

Write following code to use earlier created private assembly, but sure you have added the reference of created assembly.


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

// File name : mathclassClient.cs

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

namespace CSharp.AStepAhead.privateAssemblyClient
{
class mathClassClient
{
static void Main(string[] args)
{
try
{
int x, y, o = 0;
mathClass myObj;
for (; ; )
{
Console.Clear();
Console.Write(" *** Math Operations *** \n");
Console.Write("\n 1 Addition");
Console.Write("\n 2 Substraction");
Console.Write("\n 3 Multiplication");
Console.Write("\n 4 Division");
Console.Write("\n 5 Square");
Console.WriteLine("\n 6 Exit");

Console.Write("\n Please Select Options [1-6] : ");
o = int.Parse(Console.ReadLine());
if (o <= 0 || o > 6)
{
Console.WriteLine("\n Invalid Selection!\n Try again!");
Console.ReadLine();
continue;
}
else if (o == 6)
{
Console.WriteLine("\n You are exiting!");
Console.ReadLine();
Console.Clear();
break;
}
else
{
Console.Write("\n Enter First Number: ");
x = int.Parse(Console.ReadLine());
Console.Write("\n Enter Second Number: ");
y = int.Parse(Console.ReadLine());

myObj = new mathClass(x, y, o);
Console.WriteLine("\n Assembly Details : " + myObj.GetAssemblyFullName());
Console.WriteLine("\n Result : " + myObj.ToString());
Console.ReadLine();

}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
}

}
}
}




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#:Using Private Assembly  .  

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#:Creating Private Assembly
Previous Resource: C#:Cross Language Assembly Implementation
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