19,468
社区成员
发帖
与我相关
我的任务
分享
package main
import (
"fmt"
"io/ioutil"
"os"
"time"
"code.google.com/p/rsc/qr"
)
func main() {
if len(os.Args) < 2 {
fmt.Println("you have input text!")
os.Exit(0)
}
txt := os.Args[1]
myqr, _ := qr.Encode(txt, qr.H)
png := myqr.PNG()
name := time.Now().Format("20060102150405") + ".png"
fmt.Println("file: ", name)
ioutil.WriteFile(name, png, 0600)
}