Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[help] RFID reader + vb.net connect MySQL
20-05-2013, 02:14 PM,
Post: #1
[help] RFID reader + vb.net connect MySQL
assalamualaikum, sy masih baru lagi dgn teknologi RFID ni, dan juga penggunaan VB.net

knowledge pasal VB.net ni xde sgt.. so straight to the point sy ada beli RFID Reader + Tag dan juga dibekalkan dgn source code untuk baca ID number dlm tag tu..

screenshoot:
Spoiler:
[Image: 60HmtxW.png]

source code:
Code:
http://www.mediafire.com/download.php?4nglxcpufkvg75b
virus total:
Code:
https://www.virustotal.com/en/url/1628f39b3cd641647644c6669c80b4a5f5ae17d63c77a3c6dc0e07053a24ff17/analysis/1369030303/
ada detect 1 virus OMG OK


beli kat sini:
Code:
http://rfid.ecosensa.com/index.php/product/high-frequency/eco-hf-nfc-desktop-readerwriter

berminggu jugak stady pasal VB ni tapi since belajar sendiri susah nk faham code.. ada try refer kat forum ni tapi muncul bnyak error yg xreti nk fix..
Code:
http://forum.putera.com/tanya/index.php?/topic/91695-vb-data-to-mysql/

skang ni nk tambah code untuk connect to MySQL je problem.. ada sesiapa bole tolong? saya sanggup pergi jmpa korang (area selangor/KL) + upah sket..
[Image: pumpkids]
Reply
20-05-2013, 03:50 PM,
Post: #2
RE: [help] RFID reader + vb.net connect MySQL
sory noobs bertanya Kih3

RFID ni korang gna untuk ape?
Reply
20-05-2013, 03:50 PM, (This post was last modified: 20-05-2013, 03:51 PM by JejakaPemalu.)
Post: #3
RE: [help] RFID reader + vb.net connect MySQL
Meh datang jumpa aku kalu berminat....tp skang nih weekdays amat sebuk sikit...tp kalu ko rajin dtg jmpa aku malam ada bran???

(20-05-2013, 03:50 PM)keyoren Wrote: sory noobs bertanya Kih3

RFID ni korang gna untuk ape?

example touch n go
However near and dear you are with wife, children, friends, families they are not you; they are outside of you. The inside of you says who is near. If nothing is said than you are foreveralone. Raise your iman and you shall not be foreveralone.
Reply
20-05-2013, 04:06 PM, (This post was last modified: 20-05-2013, 04:07 PM by pumpkids.)
Post: #4
RE: [help] RFID reader + vb.net connect MySQL
@[JejakaPemalu] thx UGPM ^^
[Image: pumpkids]
Reply
20-05-2013, 05:25 PM,
Post: #5
RE: [help] RFID reader + vb.net connect MySQL
ko nak bt program untuk kedai sendiri :P
[Image: tumblr_lm3xy94MXb1qbtj1l.gif]
SMOOOTHHH X? Challenge Accepted
Reply
20-05-2013, 10:19 PM,
Post: #6
RE: [help] RFID reader + vb.net connect MySQL
sume ni saya bole buat hnya gunakan notepad shj..xperlu guna vb net pon
Reply
20-05-2013, 10:59 PM,
Post: #7
RE: [help] RFID reader + vb.net connect MySQL
(20-05-2013, 10:19 PM)tester Wrote: sume ni saya bole buat hnya gunakan notepad shj..xperlu guna vb net pon

Saudara, kawan-kawan baru nak belajar, mari kita sama-sama support tunjukkan jalan yang betul , jangan lari dari topik sebenar.
To follow the path,
Look to the master,
Follow the master,
Look through the master,
Become the master.
Reply
21-05-2013, 10:48 AM,
Post: #8
RE: [help] RFID reader + vb.net connect MySQL
nak tnya..selalunya vb.net ni pakai database apa eh..yg boleh perform dengan baik? jenis database..or app database..
[Image: tumblr_lm3xy94MXb1qbtj1l.gif]
SMOOOTHHH X? Challenge Accepted
Reply
21-05-2013, 04:47 PM,
Post: #9
RE: [help] RFID reader + vb.net connect MySQL
(21-05-2013, 10:48 AM)stranger12 Wrote: nak tnya..selalunya vb.net ni pakai database apa eh..yg boleh perform dengan baik? jenis database..or app database..
dude, stop hijjack others thread. U can create you own thread and ask.OK
Reply
21-05-2013, 08:31 PM,
Post: #10
RE: [help] RFID reader + vb.net connect MySQL
(20-05-2013, 10:19 PM)tester Wrote: sume ni saya bole buat hnya gunakan notepad shj..xperlu guna vb net pon

acah2 je dia ni -,- org minta tolong , kita bantu dia .
Can u See Me
Troll 2
Reply
21-05-2013, 09:20 PM, (This post was last modified: 21-05-2013, 09:56 PM by pumpkids.)
Post: #11
RE: [help] RFID reader + vb.net connect MySQL
thx kepada yg reply.. btw sambungan ke database mysql dah berjaya.. weeeeeee ^^
tapi ada janggal sket value yg dia masuk tu.. OK

screenshot:
Spoiler:

[Image: D4N3Eax.png]
[Image: uXSxzUD.png]
[Image: L969abw.png]


yang anehnya bila start je program value null dah masuk OK
then bila tukar kad pastu tekan request dia akan store value yg sebelumnya..

Code:
Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Imports MySql.Data.MySqlClient
Friend Class frm_main
    Inherits System.Windows.Forms.Form
    Private Sub btnTestConnection_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
        Dim MysqlConn As MySqlConnection

        MysqlConn = New MySqlConnection()

        MysqlConn.ConnectionString = "server=localhost; user id=root; password=; database=pertama"
        Try
            MysqlConn.Open()
            MessageBox.Show("Connection to Database has been opened.")
            MysqlConn.Close()
        Catch myerror As MySqlException
            MessageBox.Show("Cannot connect to database: " & myerror.Message)
        Finally
            MysqlConn.Dispose()
        End Try
    End Sub
    Private Sub addToMySql_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
        Dim MysqlConn As MySqlConnection
        Dim MysqlCommand As New MySqlCommand
        Dim queryNoID As String
        MysqlConn = New MySqlConnection()
        MysqlConn.ConnectionString = "server=localhost; user id=root; password=; database=pertama"
        queryNoID = "INSERT INTO tbl_noid (noID) VALUES (@noID);"
        Try
            MysqlCommand.Connection = MysqlConn
            MysqlCommand.CommandText = queryNoID
            MysqlCommand.Parameters.AddWithValue("@noID", tx_kh.Text)
            MysqlConn.Open()
            MysqlCommand.ExecuteNonQuery()
            MysqlConn.Close()
            MessageBox.Show("Rekod disimpan")
        Catch myerror As MySqlException
            MessageBox.Show("Gagal menyimpan rekod: " & Environment.NewLine & myerror.Message)
        Finally
            MysqlConn.Dispose()
        End Try
    End Sub
    Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
        Dim port, i, baud As Integer
        Dim j As Short
        Dim buf1(200) As Byte
        Dim b1 As Byte
        Dim s1 As String
        port = cb_ckh.SelectedIndex + 1
        If (port = 0) Then
            lb_info.Text = "Please select COM Port!"
        End If
        baud = CInt(cb_btl.Text)
        If (baud = 0) Then
            lb_info.Text = "Please select Baud rate!"
        End If
        'Open Port
        i = rf_init_com(port, baud)
        If (i <> 0) Then
            lb_info.Text = "Open Port Fail!"
            Exit Sub
        End If
        'Request
        i = rf_request(0, &H52S, j)
        If (i <> 0) Then
            lb_info.Text = "Request Fail!"
            Exit Sub
        End If
        'Anticollision
        i = rf_anticoll(0, 4, buf1(0), b1)
        If (i <> 0) Then
            lb_info.Text = "Anticollision Fail!"
            Exit Sub
        End If
        s1 = ""
        For i = 0 To b1 - 1
            s1 = s1 & VB.Right("00" & Hex(buf1(i)), 2)
        Next i
        tx_kh.Text = s1
        'Select card
        i = rf_select(0, buf1(0), 4, b1)
        If (i <> 0) Then
            lb_info.Text = "Select card fail!"
            Exit Sub
        End If
        lb_info.Text = "Select card succeed!"
    End Sub



    Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
        Dim i, m As Integer
        Dim buf1(200) As Byte
        Dim buf2(200) As Byte
        Dim s1 As String
        Dim b2, b1, b3 As Byte
        s1 = Trim(tx_key.Text)
        If (Len(s1) <> 12) Then
            lb_info.Text = "Wrong Key Length!"
            tx_key.Focus()
            Exit Sub
        End If
        For i = 0 To 5
            buf1(i) = Val("&H" & Mid(s1, i * 2 + 1, 2))
        Next i
        m = cb_kh.SelectedIndex
        If (m = -1) Then
            lb_info.Text = "Select Block Please!"
            Exit Sub
        End If
        If (op_a.Checked) Then
            b1 = &H60S
        End If
        If (op_b.Checked) Then
            b1 = &H61S
        End If
        b3 = CByte(m)
        'Authentication
        i = rf_M1_authentication2(0, b1, b3, buf1(0))
        If (i <> 0) Then
            lb_info.Text = "Authentication Fail£¡"
            Exit Sub
        End If
        'Read card
        i = rf_M1_read(0, b3, buf2(0), b2)
        If (i <> 0) Then
            lb_info.Text = "Read Card Fail!"
            Exit Sub
        End If
        s1 = ""
        For i = 0 To b2 - 1
            s1 = s1 & VB.Right("00" & Hex(buf2(i)), 2)
        Next i
        tx_sj.Text = s1
        lb_info.Text = "Read Succeed!"
    End Sub

    Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
        Dim i, m As Integer
        Dim buf1(200) As Byte
        Dim buf2(200) As Byte
        Dim s1 As String
        Dim b1, b3 As Byte
        s1 = Trim(tx_key.Text)
        If (Len(s1) <> 12) Then
            lb_info.Text = "Wrong Key Length!"
            tx_key.Focus()
            Exit Sub
        End If
        For i = 0 To 5
            buf1(i) = Val("&H" & Mid(s1, i * 2 + 1, 2))
        Next i
        m = cb_kh.SelectedIndex
        If (m = -1) Then
            lb_info.Text = "Select Block Please!"
            Exit Sub
        End If
        If (op_a.Checked) Then
            b1 = &H60S
        End If
        If (op_b.Checked) Then
            b1 = &H61S
        End If

        s1 = Trim(tx_sj.Text)
        If (Len(s1) <> 32) Then
            lb_info.Text = "Wrong Data length "
            tx_sj.Focus()
            Exit Sub
        End If
        For i = 0 To 15
            buf2(i) = Val("&H" & Mid(s1, i * 2 + 1, 2))
        Next i
        'Authentication
        b3 = CByte(m)
        i = rf_M1_authentication2(0, b1, b3, buf1(0))
        If (i <> 0) Then
            lb_info.Text = "Authentication Fail!"
            Exit Sub
        End If
        'Write card
        i = rf_M1_write(0, b3, buf2(0))
        If (i <> 0) Then
            lb_info.Text = "Write Card Fail£¡"
            Exit Sub
        End If

        lb_info.Text = "Write Succeed!"
    End Sub


    Private Sub Command4_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command4.Click
        Dim i As Integer
        i = rf_halt(0)
        If (i <> 0) Then
            lb_info.Text = "Halt Fail!"
            Exit Sub
        End If
        lb_info.Text = "Halt Succeed"
    End Sub


    Private Sub frm_main_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
        Dim i As Integer
        For i = 0 To 63
            cb_kh.Items.Insert(i, CStr(i))
        Next i
        cb_ckh.SelectedIndex = 0 : cb_btl.SelectedIndex = 1 : cb_kh.SelectedIndex = 4
    End Sub
End Class

kalau boleh mau dia auto scan je bila kita touch..
[Image: pumpkids]
Reply
16-06-2013, 08:57 PM, (This post was last modified: 16-06-2013, 09:04 PM by JejakaPemalu.)
Post: #12
RE: [help] RFID reader + vb.net connect MySQL
SOLVED with virus detected..hampeh..satu hari aku forensik remove virus dalam windows aku..

http://paste.tbd.my/1190
http://paste.tbd.my/1189
However near and dear you are with wife, children, friends, families they are not you; they are outside of you. The inside of you says who is near. If nothing is said than you are foreveralone. Raise your iman and you shall not be foreveralone.
Reply
18-06-2013, 06:17 PM,
Post: #13
RE: [help] RFID reader + vb.net connect MySQL
(16-06-2013, 08:57 PM)JejakaPemalu Wrote: SOLVED with virus detected..hampeh..satu hari aku forensik remove virus dalam windows aku..

http://paste.tbd.my/1190
http://paste.tbd.my/1189

Thank you a lot of the ring my lord.. ;d hehe
baru saja selesai presentation.. everything work like charm.. awesome.. kalau nk pengeras pm me kay.. ^^
[Image: pumpkids]
Reply


Forum Jump: