⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientconf.java

📁 这个是自由下载的
💻 JAVA
字号:
// Decompiled by DJ v2.8.8.54 Copyright 2000 Atanas Neshkov  Date: 2004-4-15 14:33:22
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   ClientConf.java

package psic;

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;

public class ClientConf
{

    public ClientConf()
    {
        CONFIG_PATH = "";
        String Os_Name = System.getProperty("os.name").toLowerCase();
        String File_Sep = System.getProperty("file.separator");
        if(Os_Name.indexOf("win") != -1)
            CONFIG_PATH = "C:" + File_Sep + "Config" + File_Sep + "Client.conf";
        if(Os_Name.indexOf("linux") != -1 || Os_Name.indexOf("unix") != -1)
            CONFIG_PATH = File_Sep + "usr" + File_Sep + "local" + File_Sep + "Config" + File_Sep + "Client.conf";
    }

    public String getParamValue(String paramName)
    {
        byte buf[] = new byte[1024];
        String paramValue;
        try
        {
            ByteArrayOutputStream b_out = new ByteArrayOutputStream();
            FileInputStream fin = new FileInputStream(CONFIG_PATH);
            int i;
            while((i = fin.read(buf, 0, buf.length)) != -1) 
            {
                b_out.write(buf, 0, i);
                b_out.flush();
            }
            String fileBuffer = b_out.toString().trim();
            b_out.close();
            fin.close();
            int index1 = fileBuffer.indexOf("<" + paramName + ">");
            int index2 = fileBuffer.indexOf("</" + paramName + ">");
            paramValue = fileBuffer.substring(index1 + (new String("<" + paramName + ">")).length(), index2);
        }
        catch(Exception exception)
        {
            return null;
        }
        return paramValue;
    }

    private String CONFIG_PATH;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -