From d7976e7aa96c42d2d9bffe940b7eb122d0fce9ff Mon Sep 17 00:00:00 2001 From: xuenhua Date: Tue, 17 Dec 2024 11:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E3=80=81=E6=B6=88=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/google/zxing/client/j2se/GUIRunner.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/google/zxing/client/j2se/GUIRunner.java b/src/com/google/zxing/client/j2se/GUIRunner.java index 636e4a7..2c1ad99 100644 --- a/src/com/google/zxing/client/j2se/GUIRunner.java +++ b/src/com/google/zxing/client/j2se/GUIRunner.java @@ -37,6 +37,8 @@ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; +import java.text.SimpleDateFormat; +import java.util.Date; import javax.imageio.ImageIO; import javax.swing.Icon; @@ -160,7 +162,12 @@ public final class GUIRunner extends JFrame implements ActionListener { BitMatrix bitMatrix; String str=textArea2.getText(); String user_dir=System.getProperty("user.dir"); - String path=user_dir+"\\qr.png"; + //long timestamp=System.currentTimeMillis(); + SimpleDateFormat sfd=new SimpleDateFormat ("yyyy-MM-dd-hh-mm-ss"); + String timestamp=sfd.format(new Date()); + + + String path=user_dir+"\\qr-"+timestamp+ ".png"; try { bitMatrix = new MultiFormatWriter().encode (str, BarcodeFormat.QR_CODE, 200, 200);//ͼƬ´óС