📄 mconfig.java
字号:
package net.jumperz.app.MTcpProxy;
import java.io.*;
import java.util.*;
public class MConfig
{
private static MConfig instance = new MConfig();
private File configFile;
private Properties prop;
private int threadCount;
private String logFileName;
private String host;
private String targetHost;
private int port;
private int targetPort;
//-----------------------------------------------------------------------------------
private MConfig()
{
// privatge !
}
//-----------------------------------------------------------------------------------
public static MConfig getInstance()
{
return instance;
}
//-----------------------------------------------------------------------------------
public void load( String configFileName )
throws IOException
{
configFile = new File( configFileName );
prop = new Properties();
prop.load( new FileInputStream( configFile ) );
threadCount = Integer.parseInt( prop.getProperty( "threadCount" ) );
logFileName = prop.getProperty( "logFileName" );
port = Integer.parseInt( prop.getProperty( "port" ) );
targetPort = Integer.parseInt( prop.getProperty( "targetPort" ) );
host = prop.getProperty( "host" );
targetHost = prop.getProperty( "targetHost" );
}
//-----------------------------------------------------------------------------------
public String getLogFileName()
{
return logFileName;
}
//-----------------------------------------------------------------------------------
public int getThreadCount()
{
return threadCount;
}
//-----------------------------------------------------------------------------------
public String getHost() {
return host;
}
public int getPort() {
return port;
}
public String getTargetHost() {
return targetHost;
}
public int getTargetPort() {
return targetPort;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -