求各位老大讲一下这个软件的算法。
PB的程序,先PBKILL发现IF (((((((upper(PARENT.sle_2.text) = "DVCHEN" OR upper(PARENT.sle_2.text) = "DVCHEN") OR upper(PARENT.sle_2.text) = "DVCHEN") OR upper(PARENT.sle_2.text) = "CHINADFORCE") OR upper(PARENT.sle_2.text) = "CHINAOCN") OR PARENT.sle_2.text = "5CCLUB") OR PARENT.sle_2.text = "樱园阁酒店") OR upper(PARENT.sle_2.text) = "5CCLUB") THEN //0
messagebox("提示","注册成功!!!")
RETURN
END IF //0
ls_hotel_name = PARENT.sle_2.text
IF PARENT.sle_1.text = convert10to16(f_get_py(ls_hotel_name)) THEN //4
messagebox("信息","注册成功,感谢您购买")
ELSE //4
messagebox("信息","你输入的注册号码不正确")
END IF //4
RETURN
IF PARENT.sle_1.text = convert10to16(f_get_py(ls_hotel_name)) THEN //4
messagebox("信息","注册成功,感谢您购买")
ELSE //4
messagebox("信息","你输入的注册号码不正确")
END IF //4
然后又找到f_get_py(ls_hotel_name)这个函数
//Public function f_get_py (string hz) returns string
//string hz
string qsss
string retstr
integer qlen
integer hb
integer lb
integer i
integer h
integer l
qsss = trim(hz)
qlen = len(qsss)
hb = 176
lb = 160
retstr = ""
i = 1
do while i <= qlen
h = asc(mid(qsss,i,1))
if h < 160 then
retstr = retstr + char(h)
i = i + 1
else
l = asc(mid(qsss,i + 1,1))
choose case h
case hb
if l <= lb + 36 then
retstr = retstr + "A"
else
retstr = retstr + "B"
end if
case hb + 1
retstr = retstr + "B"
case hb + 2
if l <= lb + 32 then
retstr = retstr + "B"
else
retstr = retstr + "C"
end if
case hb + 3
retstr = retstr + "C"
case hb + 4
if l <= lb + 77 then
retstr = retstr + "C"
else
retstr = retstr + "D"
end if
case hb + 5
retstr = retstr + "D"
case hb + 6
if l <= lb + 73 then
retstr = retstr + "D"
else
retstr = retstr + "E"
end if
case hb + 7
if l <= lb + 1 then
retstr = retstr + "E"
else
retstr = retstr + "F"
end if
case hb + 8
if l <= lb + 32 then
retstr = retstr + "F"
else
retstr = retstr + "G"
end if
case hb + 9
if l <= lb + 93 then
retstr = retstr + "G"
else
retstr = retstr + "H"
end if
case hb + 10
retstr = retstr + "H"
case hb + 11
if l <= lb + 86 then
retstr = retstr + "H"
else
retstr = retstr + "J"
end if
case + 14 >=
retstr = retstr + "J"
case hb + 15
if l <= lb + 6 then
retstr = retstr + "J"
else
retstr = retstr + "K"
end if
case hb + 16
if l <= lb + 11 then
retstr = retstr + "K"
else
retstr = retstr + "L"
end if
case hb + 17
retstr = retstr + "L"
case hb + 18
if l <= lb + 71 then
retstr = retstr + "L"
else
retstr = retstr + "M"
end if
case hb + 19
retstr = retstr + "M"
case hb + 20
if l <= lb + 34 then
retstr = retstr + "M"
else
retstr = retstr + "N"
end if
case hb + 21
if l <= lb + 21 then
retstr = retstr + "N"
else
if l <= lb + 29 then
retstr = retstr + "O"
else
retstr = retstr + "P"
end if
end if
case hb + 22
if l <= lb + 57 then
retstr = retstr + "P"
else
retstr = retstr + "Q"
end if
case hb + 23
retstr = retstr + "Q"
case hb + 24
if l <= lb + 26 then
retstr = retstr + "Q"
else
if l <= lb + 85 then
retstr = retstr + "R"
else
retstr = retstr + "S"
end if
end if
case + 26 >=
retstr = retstr + "S"
case hb + 27
if l <= lb + 88 then
retstr = retstr + "S"
else
retstr = retstr + "T"
end if
case hb + 28
retstr = retstr + "T"
case hb + 29
if l <= lb + 57 then
retstr = retstr + "T"
else
retstr = retstr + "W"
end if
case hb + 30
if l <= lb + 83 then
retstr = retstr + "W"
else
retstr = retstr + "X"
end if
case + 32 >=
retstr = retstr + "X"
case hb + 33
if l <= lb + 24 then
retstr = retstr + "X"
else
retstr = retstr + "Y"
end if
case + 35 >=
retstr = retstr + "Y"
case hb + 36
if l <= lb + 48 then
retstr = retstr + "Y"
else
retstr = retstr + "Z"
end if
case + 39 >=
retstr = retstr + "Z"
case else
retstr = retstr + "%"
end choose
i = i + 2
end if
loop
还有这个函数
convert10to16
//Public function convert10to16 (string mstring) returns string
//string mstring
string ls_first
string ls_second
string ls_16
string ls_return
string ls_dec_9="9"
string ls_dec_0="0"
string ls_dec_a="A"
long ll_start=1
integer li_char
integer li_hex=16
integer li_int
integer li_hexlen=2
integer li_dec=10
integer li_char_spacebar
ls_return = ""
FOR ll_start = 1 TO len(mstring) //1
li_char = asc(mid(mstring,ll_start,1))
li_char_spacebar = li_char
ls_16 = ""
DO UNTIL li_char <= 0 //5
li_int = mod(li_char,li_hex)
li_char = int(li_char / li_hex)
IF li_int >= li_dec THEN //8
ls_16 = char(li_int - 10 + asc(ls_dec_a)) + ls_16
CONTINUE
END IF //8
ls_16 = string(li_int) + ls_16
LOOP //5
li_char = len(ls_16)
IF li_char < li_hexlen THEN //14
ls_16 = ls_dec_0 + ls_16
END IF //14
ls_return = ls_return + ls_16
NEXT //1
RETURN ls_return
我稍微能看懂一点,放到VB里面,老是错误,请各位大老大不吝赐教。
[ 本帖最后由 walili 于 2010-1-2 09:44 编辑 ] 知道这不是VB代码,已经转过VB了,就是求出来的数和转换格式好像不对。
if h < 160 then
retstr = retstr + char(h)
i = i + 1
else
l = asc(mid(qsss,i + 1,1))
就像这句,我VB里求出来的和他一点也不一样,各位老大能告诉一下吗? 原帖由 walili 于 2010-1-3 07:42 发表 https://www.chinapyg.com/images/common/back.gif
知道这不是VB代码,已经转过VB了,就是求出来的数和转换格式好像不对。
if h < 160 then
retstr = retstr + char(h)
i = i + 1
else
l = asc(mid(qs ...
VB中ASCII码转字符是Chr,不是char 唉,老大,俺用的是VB.NET,所以晕了,小弟实在是菜鸟一只还希望能够解析一下。
尤其是h = asc(mid(qsss,i,1)) 如果是中文“中”我用VB.NET获得好像6万多,但是我用普通的计算工具得到“D6D0”,然后就没法计算了,所以说实在是太晕了,可怜小弟的一片学习之心,查了好多资料,说要转换来转换去实在是头都大了,搞的我现在都想去学DELPHI了。
[ 本帖最后由 walili 于 2010-1-3 20:56 编辑 ] 原帖由 walili 于 2010-1-3 20:47 发表 https://www.chinapyg.com/images/common/back.gif
唉,老大,俺用的是VB.NET,所以晕了,小弟实在是菜鸟一只还希望能够解析一下。
尤其是h = asc(mid(qsss,i,1)) 如果是中文“中”我用VB.NET获得好像6万多,但是我用普通的计算工具得到“D6D0”,然后就没法计算了 ...
h = asc(mid(qsss,i,1)) 这一句是获取字符串qsss中第i个字符的ASCII码
如果是中文 那获取的是国标码 转换成十进制 当然数就比较奇怪了 你把得到的数转成16进制就是你计算工具得到的结果
[ 本帖最后由 sjh717142 于 2010-1-3 21:23 编辑 ] 老大,你还能帮我改一下VB.NET的代码帮我发一下啊,/:L
页:
[1]