在java app中检测第一次用户 [英] Detect first time user in java app

查看:245
本文介绍了在java app中检测第一次用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的java桌面应用程序知道用户是否第一次在该PC上运行它。由于jar文件可能在用户之间共享,我不想写入jar文件中的文件。
显然有很多方法可以做到这一点,但你会推荐什么? (它必须是跨平台的)。谢谢

I want my java desktop application to know if the user is running it for the first time on that pc. Since the jar-file might be shared between users i don't want to write to a file inside the jar-file. There are obviously a lot of ways to do this but what would you recommend? (It has to be cross-platform). thanks

推荐答案

尝试使用首选项及其 systemRoot() userRoot()方法,用于获取系统范围或用户特定的首选项。

Try to use Preferences and its systemRoot() or userRoot() methods to obtain system-wide or user-specific preferences.

这篇关于在java app中检测第一次用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆