From eb2e7c97dc1416b84f0c7aaef33f95dede358493 Mon Sep 17 00:00:00 2001 From: pjyhawmv7 <1447855257@qq.com> Date: Mon, 18 Mar 2024 21:39:29 +0800 Subject: [PATCH] Add liwei_branch --- liwei_branch | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 liwei_branch diff --git a/liwei_branch b/liwei_branch new file mode 100644 index 0000000..fa57a40 --- /dev/null +++ b/liwei_branch @@ -0,0 +1,32 @@ +// 定义一个简单的Java类,用于演示如何读取小米便签中的数据。 +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +public class MiNoteReader { + + public static void main(String[] args) { + try { + // 假设便签数据存储在一个名为notes.properties的文件中 + File propertiesFile = new File("notes.properties"); + FileInputStream fis = new FileInputStream(propertiesFile); + Properties properties = new Properties(); + + // 加载文件内容到Properties对象中 + properties.load(fis); + + // 读取属性 + String note1 = properties.getProperty("note1"); + String note2 = properties.getProperty("note2"); + + // 打印便签内容 + System.out.println("第一条便签记录: " + note1); + System.out.println("第二条便签记录: " + note2); + + // 关闭文件输入流 + fis.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } +} \ No newline at end of file -- 2.34.1