В этом классе все данные:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Social
{
class human
{
public string nickname { set; get; }
public string password{set;get;}
public int id_human{set;get;}
public string name{set;get;}
public string lastname{set;get;}
public string secondname{set;get;}
}
}
Здесь функция:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace Social
{
class function
{
public void registration(human hmn)
{
BinaryWriter str= new BinaryWriter(new FileStream("lol.bin",FileMode.Create,FileAccess.Write));
str.Write(hmn.secondname);
str.Close();
}
}
Здесь сам вызов:
namespace Social
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
human hmn = new human();
function fnc = new function();
hmn.nickname = textBox1.Text;
hmn.password = textBox2.Text;
hmn.id_human = Int32.Parse(textBox3.Text);
hmn.name = textBox4.Text;
hmn.lastname = textBox5.Text;
hmn.secondname = textBox6.Text;
fnc.registration(hmn);
}
}
}