1-) C# -
.dll oluşturma ve c# da o degerlere deger gonderip çekme
1-)File->new Project->Class Library de ve aşşağıdaki kodu yaz
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Dll_yaz1
{
public class Class1
{
public int topla(int a,int b)
{
return a + b;
}
}
}
2-)File->new Project->Windows Forms Application de ve aşşağıdaki kodu yaz
2.1-)project->add referance->solution->dll_yaz1 i ekle sonra aşşağıdakini yaz
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace dll_cagir
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Dll_yaz1.Class1 s = new Dll_yaz1.Class1();
Console.WriteLine( s.topla(2, 1));
button1.Text = s.topla(2, 1)+"";
}
}
}