Introduction - If you have any usage issues, please Google them yourself
g code = this.txtbarcode.Text.Trim()
string fileName = "barcodeinfo.txt"
StreamReader sr = new StreamReader(fileName, Encoding.Default) //以gb2312字符编码格式读取文本。
string str
int count=0
while ((str = sr.ReadLine()) != null)//读取每一行
{
if (str.IndexOf(code) == 0)
{
this.listBoxCode.Items.Add(str)
this.listBoxCode.SelectedIndex = this.listBoxCode.Items.Count- 1
count = count+ 1
}
}
if (count == 0)
{
this.listBoxCode.Items.Add(code+ " 无条码信息")
this.listBoxCode.SelectedIndex = this.listBoxCode.I