资源简介
Main.zip

代码片段和文件信息
package dk.fullcontrol.fps;
import java.io.IOException;
import java.io.FileOutputStream;
import java.lang.reflect.InvocationTargetException;
import scala.testing.SUnit.Test;
import com.smartfoxserver.v2.entities.data.SFSobject;
import com.smartfoxserver.v2.protocol.binary.DefaultPacketCompressor;
//����ʱ������
public class Main {
public static void main(String[] args) throws ClassNotFoundException IllegalAccessException IllegalArgumentException InvocationTargetException NoSuchMethodException SecurityException InstantiationException IOException {
SFSobject license = new SFSobject();
license.putUtfString(“customer“ ““);// 授权人,为空则为共享版,否则个人版
license.putUtfString(“bind“ “47.95.28.187“);// 限制IP ,也就是服务器的公网IP!!如果写内网IP则只能在内网上访问。
license.putInt(“users“ -1);// 连接数上限,-1为无限数量
license.putLong(“expire“ 0);// 版权到期时间,0为无限制
license.putBool(“private“ false);// 私有?
byte[] objectBytes = license.toBinary();
try {
objectBytes = new DefaultPacketCompressor().compress(objectBytes);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
byte[] licenseData = new byte[objectBytes.length + 4];
for (int i = 0; i < objectBytes.length; i++) {
licenseData[i + 4] = (byte) (objectBytes[i] ^ licenseData[2]);
}
new FileOutputStream(“C:\\license.2x“).write((byte[]) licenseData); //设置保存的路径
//
//
//DFResLoader loader = new DFResLoader(Main.class.getClassLoader());
//
//loader.init(new FileInputStream(“lib\\Lib\\sfs2x-lms.jar“));
//
//
//long expireTime = 4476614400000l;//new Date(2111-1900 10 11).getTime();
//
//
//
//ISFSobject license = new SFSobject();
//
//license.putUtfString(“customer“ ““);//��Ȩ�ˣ�Ϊ����Ϊ����棬������˰�
//
//license.putUtfString(“bind“ “127.0.0.1“);//����IP
//
//license.putInt(“users“ -1);//���������ޣ�-1Ϊ��������
//
//license.putLong(“expire“ 0);//expireTime ��Ȩ����ʱ�䣬0Ϊ������
//
//license.putBool(“private“ false);//˽�У�
//
//
////sfs.lms.d.w
//
//Class da = loader.loadClass(“sfs.lms.b.v“);
//
////���浽config/license.2x
//
//da.getMethod(“D“ ISFSobject.class).invoke(da.newInstance() license);
//if (args.length > 0) {
//clusterMode = args[0].equalsIgnoreCase(“cluster“);
//useConsole = args.length > 1 && args[1].equalsIgnoreCase(“console“);
//}
//final SmartFoxServer sfs2X = SmartFoxServer.getInstance();
//sfs2X.setClustered(clusterMode);
//if (useConsole)
//sfs2X.startDebugConsole();
//sfs2X.start();
//}
//public static byte[] getStream(FileInputStream fileInputStream) {
// byte[] d;
// try {
// d = new byte[fileInputStream.available()];
// fileInputStream.read(d);
// return d;
// } catch (IOException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
// return null;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3228 2017-09-20 13:14 Main.java
- 上一篇:机票预定系统数据库系统设计
- 下一篇:软件体系结构复习资料
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论