package com.huatek.frame.base;

import cn.hutool.core.net.NetUtil;
import com.huatek.frame.base.util.Md5Util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class VerifyDongle {

    public static void main(String[] args) throws IOException {
        //验证加密
//        InetAddress inetAddress = InetAddress.getLocalHost();
//        String localMacAddress2 = NetUtil.getMacAddress(inetAddress);
//        String ip =inetAddress.getHostAddress();
//        String sourseNew = Md5Util.md5("Xinying"+ip+localMacAddress2).toUpperCase();
        String sourseNew = Md5Util.md5("Xinying"+"192.168.128.25"+"9C:C2:C4:62:3B:8B").toUpperCase();
        String url = "D:\\new\\";

        String FileName = "dongle.dat";

        File file = new File(url);

        file.mkdirs();//创建文件夹

        File fil = new File(url);

        fil.createNewFile();

        FileWriter fileWriter=new FileWriter(url+FileName);

        fileWriter.write(sourseNew);//写入文件

        fileWriter.close();
    }
}
