MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    关于读取文件的问题

    开发交流
    4
    6
    540
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 千
      千以亦猫 last edited by

      比如我有个配置文件,我该把他放在哪里才能读到?

      1 Reply Last reply Reply Quote -1
      • Eric归梦
        Eric归梦 摸鱼 last edited by StageGuard

        放在心里 (bushi

        1 Reply Last reply Reply Quote -1
        • Under-estimate
          Under-estimate 摸鱼 last edited by

          如果是mirai-console的插件的话可以用

          插件主类.INSTANCE.resolveConfigFile("文件路径");
          

          获取配置文件存储路径

          千 1 Reply Last reply Reply Quote 0
          • 千
            千以亦猫 @Under-estimate last edited by

            @under-estimate 我是用mybatis的框架,需要读取配置文件,不知道该读哪里

            Under-estimate 1 Reply Last reply Reply Quote 0
            • Under-estimate
              Under-estimate 摸鱼 @千以亦猫 last edited by

              如果你的项目需要用户去设置有关数据库的相关信息的话,可以使用PluginConfig,不需要自己去实现配置文件的读取操作。

              1 Reply Last reply Reply Quote 0
              • Him188
                Him188 last edited by

                Java
                获取插件配置目录: 插件主类.INSTANCE.getConfigDir();
                获取插件数据目录: 插件主类.INSTANCE.getDataDir();

                配置目录存放可能被用户修改的内容, 数据目录存放用户不应该修改的内容.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact