zoukankan
html css js c++ java
SQLDBCompare2.4 序列号代码
private
void
button1_Click(
object
sender, EventArgs e)
{
textBox1.Text
=
GenerateNewKey(
"
$BE$T$
"
,
102
,
false
,
500
);
}
public
static
string
GenerateNewKey(
string
strSecurityCode,
int
nProductCode,
bool
bTrial,
int
nTrialDays)
{
if
(
!
strSecurityCode.Equals(
"
$BE$T$
"
))
{
return
""
;
}
string
str
=
Guid.NewGuid().ToString().Replace(
"
-
"
,
""
);
string
str2
=
""
;
if
(bTrial)
{
str2
=
"
2
"
+
nTrialDays.ToString(
"
D3
"
)
+
"
00000000
"
+
nProductCode.ToString(
"
D3
"
);
}
else
{
str2
=
"
1123ABCDEFGH
"
+
nProductCode.ToString(
"
D3
"
);
}
char
[] chArray
=
(str
+
"
$
"
+
str2).ToCharArray();
byte
[] inArray
=
new
byte
[chArray.Length];
for
(
int
i
=
0
; i
<
chArray.Length; i
++
)
{
inArray[i]
=
(
byte
)chArray[i];
}
string
strKey
=
Convert.ToBase64String(inArray);
string
str4
=
GetStringCheckSumValue(strKey).ToString(
"
D3
"
);
return
(strKey
+
str4);
}
public
static
int
GetStringCheckSumValue(
string
strKey)
{
int
i1
=
0
;
byte
b2
=
1
;
for
(
int
i2
=
0
; i2
<
strKey.Length; i2
++
)
{
byte
b1
=
(
byte
)strKey[i2];
for
(
int
i3
=
0
; i3
<
8
; i3
++
)
{
if
((b1
&
(b2
<<
(i3
&
31
)))
==
0
)
i1
++
;
}
}
return
i1;
}
查看全文
相关阅读:
mongodb压缩——snappy、zlib块压缩,btree索引前缀压缩
python cassandra 创建space table并写入和查询数据
机器学习算法选择——特征提取
机器学习的算法选择
公积金联名卡——提取公积金用,用身份证即可办理
Facebook图片存储系统Haystack——存小文件,本质上是将多个小文件合并为一个大文件来降低io次数,meta data里存偏移量
HDFS namenode 高可用(HA)搭建指南 QJM方式 ——本质是多个namenode选举master,用paxos实现一致性
javascript语言精粹:继承
转:Javascript的10个设计缺陷
转:CSS选择器笔记
原文地址:https://www.cnblogs.com/lovebanyi/p/927869.html
最新文章
uboot启动阶段修改启动参数方法及分析
UVA 445
系统临时文件批量删除方法
MyEclipse 2013 新功能介绍
c# winform 子窗体访问父窗体中的方法和变量
网站登录密码忘记后,通过向手机发送验证码实现找回密码的实现方法
Android学习-各种对话框
构建高性能服务(三)Java高性能缓冲设计 vs Disruptor vs LinkedBlockingQueue--转载
LMAX Disruptor – High Performance, Low Latency and Simple Too 转载
spring jdbctemplate源码跟踪
热门文章
javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher--转载
spring data redis使用示例
jackson使用示例
Spring RESTFul Client – RestTemplate Example--转载
spring security之httpSecurity使用示例
Spring SqlRowSet example--转载
spring security源码分析之web包分析
Go语言的管道Channel用法
mongodb给我们提供了fsync+lock机制把数据暴力的刷到硬盘上
cassandra压缩——从文档看,本质上也应该是在做块压缩
Copyright © 2011-2022 走看看