[英]How can pass textBox value to another class
我可以按文本框值輸入類文件嗎
Windows表格:
private void button1_Click(object sender, EventArgs e)
{
string Staffid = Staffid_txt.Text;
string Pwd = Pwd_txt.Text;
dbConnect.UserAuthCommd();
dbConnect:
public ConnectDB()
{
Initialize();
}
.
.
.
public void UserAuthCommd()
我不知道如何獲取Staffid,Pwd到dbConnect以及如何使用staffid和pwd進行SQL查詢
如果UserAuthCommd
方法需要字符串值,則使其接受字符串值:
public void UserAuthCommd(string staffId, string password)
{
//...
}
並在調用它時傳遞值:
dbConnect.UserAuthCommd(Staffid_txt.Text, Pwd_txt.Text);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.