Golang mifare Card read/write by calling Win32 DLL under SYSCALL

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Many students, such as I like Golang, but still need to call a lot of legacy projects or other excellent open source projects, how to do? The way we think about it is to combine CGO with the Syscall in the package.


Note that there are pits here:

Show not enough arguments in call to Syscall when I debug. Syscall

[' Go run Dms.go ' | done:260.3744ms]
# command-line-arguments
. \dms.go:72:not enough arguments in call to Syscall. Syscall

Exit Status 2

Because I'm referring to the http://golang.org/pkg/syscall/#Syscall, and its default is Linux/unix's Syscall API doc description,

How to look at Windows Golang Doc?


Act 1:

by Godoc command, call godoc-http=:6060
Then open the http://localhost:6060/pkg/syscall/#Syscall in the browser, which is the Golang package API for Windows

Law 2:Http://golang.org/src/pkg/syscall/syscall_windows.go


Project Combat


Mifare card Read and write:

Lib:

Https://github.com/philsong/golang_samples/blob/master/src/mif/mif.go

TestApp

Https://github.com/philsong/golang_samples/tree/master/src/dms


The end.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.