有一个办法,在调用你的组件之前先执行组件中的InitLicense(byval Key as string,byval License as string)方法,其中Key是一个随机密钥,License是一个根据Key算出的值。在你的组件内部进行判断即可。不过这是一个土方法,T2(無藥可救) 说的License方法比较正规
to:bucher(bucher) 那你能不能给我你的代码学习学习?
private Cando as booleanpublic sub InitLicense(byval Key as string,byval License as string) Cando=CheckKey(byval Key as string,byval License as string) end subprivate function CheckKey(byval Key as string,byval License as string) as boolean '这里是密钥算法,把这里换成你自己的算法 dim strtmp as string strtmp=key & "aaa" checkkey=(License = strtmp) '检测License是否等于Key & "aaa" end functionpublic sub DoSomething() '在这里检验合法性 if not cando then msgbox "#$$%^^&&**&" exit sub endif '在这里写下你的代码 ......... end sub
那你能不能给我你的代码学习学习?
Cando=CheckKey(byval Key as string,byval License as string)
end subprivate function CheckKey(byval Key as string,byval License as string) as boolean '这里是密钥算法,把这里换成你自己的算法
dim strtmp as string
strtmp=key & "aaa"
checkkey=(License = strtmp) '检测License是否等于Key & "aaa"
end functionpublic sub DoSomething()
'在这里检验合法性
if not cando then
msgbox "#$$%^^&&**&"
exit sub
endif
'在这里写下你的代码
.........
end sub