BDU/ATS/Tools/SecurityDongle.cs

33 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using ;
namespace ATS.Tools
{
public class SecurityDongle
{
public static double Verify()
{
//第一次使用时需要写入加密狗,之后注释掉写入代码即可
//加密狗驱动类.写入加密狗(0, "00000000", "ATS项目");//00000000表示管理员密码ATS项目表示校验密码
//使用用户密码和校验密码寻找加密狗返回值小于0表示未找到或验证失败
var re = .("11111111", "ATS项目");
if (re < 0) return 0;
//在这里设置到期时间20260401
// 设置到期时间2026年4月1日
DateTime = new DateTime(2026, 4, 1, 0, 0, 0);
DateTime = DateTime.Now;
// 返回剩余毫秒数(或秒数、分钟数,根据需求)
return (long)( - ).TotalHours;
}
}
}