小编use*_*883的帖子

字符串变量= a textbox.text

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

无法隐式转换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)

c# string variables

2
推荐指数
1
解决办法
98
查看次数

标签 统计

c# ×1

string ×1

variables ×1