0
我怎么能把条件放在这里。就像如果我输入一个4位数的字符,它会把一个前缀是“F-”。C#字符计数条件
try
{
Service1 ws = new Service1();
if (e.KeyChar == (char)13 && button1.Enabled == true)
{
inputtxt = F.Text.ToString();
showpic(inputtxt);
if (ws.VerifyEID(inputtxt) == false)
{
MessageBox.Show("You have entered an incorrect Employee ID. Please try again!", "Attendance Monitoring System", MessageBoxButtons.OK, MessageBoxIcon.Warning);
F.Text = null;
}
else
{
panel1.Visible = false;
SqlToText(inputtxt);
ShowOffset(inputtxt);
if (BtnTimeIn.Visible == true)
{
BtnTimeIn.Focus();
}
else
{
BtnTimeOut.Focus();
}
}
}
请帮助我,谢谢。
您的代码似乎并不完整,并且不会编译为当前状态。 – juharr
好的,所以你想在字符串前添加“f”,并且我假设你想要它在你有不完整的行的地方'if if(inputtext ='? – Ben
My bad,Disregard that。I was editing the code while im在这里张贴,所以我不小心将它包括在内,呃,先生可以帮我 – Chddz