手机短信收发[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 lotusswan 的 blog

手机短信发送

²        中文转换成unicode码函数

 

因为手机短消息的发送是以pdu串的形式发送出去的,中文字符以unicode码来表示,所以在发送中文短消息之前必须首先将中文字符转换为unicode码,下面的函数将实现这个功能。这个函数主要应用到vb自带的一个格式转换函数:chrw()将中文转换为unicode码。

 

public function chg(rmsg as string) as string

dim tep as string

dim temp as string

dim i as integer

dim b as integer

tep = rmsg

i = len(tep)

b = i / 4

if i = b * 4 then

    b = b - 1

                  tep = left(tep, b * 4)

else

           tep = left(tep, b * 4)

end if

chg = ""

for i = 1 to b

 temp = "&h" & mid(tep, (i - 1) * 4 + 1, 4)

     chg = chg & chrw(cint(val(temp)))

next i

end function

本文关键:VB,SMS,收发,函数
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top