字符串变量= a textbox.text

use*_*883 2 c# string variables

我研究过的每个地方都应该工作,但它不会...我基本上试图让我的变量商店在一个类中工作在我的主表单上.我一直收到错误代码

无法隐式转换stringForm1.Employee

我的表格代码

Employee FirstName = new Employee();
if (Directions.Text == "Please Enter Employee First Name")
{
    FirstName = Info.Text;
    Directions.Text = "Please Enter Employee Last Name";
}
Run Code Online (Sandbox Code Playgroud)

在我的第二堂课中

public class Employee
{
    public string FirstName;
}
Run Code Online (Sandbox Code Playgroud)

Mar*_*ell 7

Employee employee = new Employee();
if (Directions.Text == "Please Enter Employee First Name")
{
    employee.FirstName = Info.Text;
    Directions.Text = "Please Enter Employee Last Name";
}
Run Code Online (Sandbox Code Playgroud)