程序代码:
Option Explicit '把excel的数据复制到文档文件,并改名为 "localdata.txt" Private Type product infor As String * 13 '13位条码 tab As String * 7 '7个空格 End Type Sub localprouct() Dim num As Integer, myproduct As product Open App.Path + "localdata.txt" For Random As #1 Len = Len(myproduct) For num = 1 To 10000 Get #1, num, myproduct If myproduct.infor = Text1.Text Then Exit Sub: Label1.Caption = "合法条码" Next num Label1.Caption = "非法条码" Close #1 End Sub