[.NET] 書上的範例
小弟是新手 在一本書的教如何設計RFID程式的範例中
遇到了問題 程式碼是這樣的:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AxMSComm1.Settings = "19200,n,8,1"
AxMSComm1.CommPort = 5
AxMSComm1.RThreshold = 1
AxMSComm1.PortOpen = True
If AxMSComm1.PortOpen = True Then
MessageBox.Show("開啟")
Else
MessageBox.Show("失敗")
End If
End Sub
Dim tagcode As String
Private Sub AxMSComm1_OnComm(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles AxMSComm1.OnComm
Dim I As Integer
Select Case AxMSComm1.CommEvent
Case 2
tagcode = tagcode & AxMSComm1.Input
If InStr(tagcode, vbCrLf) Then
I = InStr(tagcode, vbCrLf) - 1
If Len(Mid(Trim(tagcode), 1, I)) < 16 Then Exit Sub
TextBox2.Text = Mid(Trim(tagcode), 1, I)
tagcode = ""
End If
Case 7
MsgBox("錯誤", 8, "錯誤")
AxMSComm1.PortOpen = False
End Select
End Sub
End Class
設備的連接上都照著設備廠商提供的數據去修改了
但在執行上只顯示開啟 卻讀不出卡號??
試了很多次 還是不行 不知問題出在哪裡...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 120.126.19.244
推
10/10 01:04, , 1F
10/10 01:04, 1F