.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> WPF >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

how to create dll

Posted By:siri.k       Posted Date: March 12, 2011    Points: 40    Category: WPF    URL: http://www.dotnetspark.com  

simple dll creation prg for biginners

step 1)

//open microsoft vs 2010  -> new prj -> class library ->name ->dll
// page open then write code like this here we r creating dll for addition of two numbers..

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dll
    public class Class1

        public int add(int a, int b)
            int c;
            c = a + b;
            return c;

// a dll file will created in folder where u save this

// go to path where u save this class lib prj -> goto bin -> debug -> dll ** file is availble....

step 2)

then open vs 2010 express in that -> new prj -> wpf application-> give name to the appl

page will open, and the add the refernce to this for adding ref go to sol explorer right clik refernce add refence ->dll** which we had created earlier.

 in XAML design  page just take three text boxes one for varible a another for b and the third one to store the result...

one button...after button clik jus write the code in Xaml.cs file...............

  private void button1_Click(object sender, RoutedEventArgs e)
            dll.Class1 ob = new dll.Class1();
            int a = Convert.ToInt32(textBox1.Text);
            int b = Convert.ToInt32(textBox2.Text);
            textBox3.Text = ob.add(a, b).ToString();

hmm lastly see the ouput

this is sample dll program for beginners..................................................


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend