用手机号查找手机位置 两个苹果手机无法共享位置
【主要代码如下】
"(注:我自己用的不是这种方法,我讨厌for循环.)
option explicit
private const cstbase64 = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789 /"
private arrbase64() as string
"作者:同济黄正
"00100001 00100001 00100001 --源码
"00001000 00010010 00000100 00100001 --base64码
public function base64encode(strsource as string) as string
on error resume next
"适用于中、英文的base64编码/解码vb6超精简版 作者:同济黄正
if ubound(arrbase64) = -1 then
arrbase64 = split(strconv(cstbase64, vbunicode), vbnullchar)
end if
dim arrb() as byte, btmp(2) as byte, bt as byte
dim i as long, j as long
arrb = strconv(strsource, vbfromunicode)
j = ubound(arrb)
for i = 0 to j step 3
erase btmp
btmp(0) = arrb(i 0)
btmp(1) = arrb(i 1)
btmp(2) = arrb(i 2)
bt = (btmp(0) and 252) / 4
base64encode = base64encode & arrbase64(bt)
bt = (btmp(0) and 3) * 16
bt = bt btmp(1) \ 16
base64encode = base64encode & arrbase64(bt)
bt = (btmp(1) and 15) * 4
bt = bt btmp(2) \ 64
if i 1 <= j then
base64encode = base64encode & arrbase64(bt)
else
base64encode = base64encode & "="
end if
bt = btmp(2) and 63
if i 2 <= j then
base64encode = base64encode & arrbase64(bt)
else
base64encode = base64encode & "="
end if
next
end function
public function base64decode(strencoded as string) as string
"适用于中、英文的base64编码/解码vb6超精简版 作者:同济黄正
on error resume next
dim arrb() as byte, btmp(3) as byte, bt, bret() as byte
dim i as long, j as long
arrb = strconv(strencoded, vbfromunicode)
j = instr(strencoded & "=", "=") - 2
redim bret(j - j \ 4 - 1)
for i = 0 to j step 4
erase btmp
btmp(0) = (instr(cstbase64, chr(arrb(i))) - 1) and 63
btmp(1) = (instr(cstbase64, chr(arrb(i 1))) - 1) and 63
btmp(2) = (instr(cstbase64, chr(arrb(i 2))) - 1) and 63
btmp(3) = (instr(cstbase64, chr(arrb(i 3))) - 1) and 63
bt = btmp(0) * 2 ^ 18 btmp(1) * 2 ^ 12 btmp(2) * 2 ^ 6 btmp(3)
bret((i \ 4) * 3) = bt \ 65536
bret((i \ 4) * 3 1) = (bt and 65280) \ 256
bret((i \ 4) * 3 2) = bt and 255
next
base64decode = strconv(bret, vbunicode)
end function