지금 코드는 전체 텍스트 파일을 가져 와서 하나의 텍스트 상자에 배치합니다. 어떻게해야하는지 알아 내려고하는 것은 파일의 각 줄을 각기 다른 텍스트 상자에 넣는 것입니다.텍스트 파일을 파트/라인으로 나누고 텍스트 상자에 파트를 넣습니다.
namespace HomeInventory2
{
public partial class Form1 : Form
{
public Form1(string prepopulated)
{
InitializeComponent();
textBoxAmount.Text = prepopulated;
}
private void label1_Click(object sender, EventArgs e)
{
}
private void submitButton_Click(object sender, EventArgs e)
{
CreateInventory create = new CreateInventory();
create.ItemAmount = textBoxAmount.Text;
create.ItemCategory = textBoxCategories.Text;
create.ItemProperties = textBoxValue.Text;
create.ItemValue = textBoxValue.Text;
InventoryMngr invtryMngr = new InventoryMngr();
invtryMngr.Create(create);
}
}