金笛工业手机论坛  

返回   金笛工业手机论坛 > 工作与生活 > 谈天说地

谈天说地 其实就是水...

回复
 
LinkBack 主题工具 显示模式
旧 2009-10-22   #1 (permalink)
高级会员
 
注册日期: 2009-07-03
帖子: 158
短信销售筱萱 正向着好的方向发展
发送 AIM 消息给 短信销售筱萱 发送 MSN 消息给 短信销售筱萱
默认 如何在vb中将汉字转化成unicode

A.发送中文例子:
发送中文有两种方法,一种是PDU,一种是UCS2文本
1.PDU方法:
at+cmgf=0
at+cmgs=24
>0891683108100005F011000B813109018759F10008A70A00650073007496484E30
信息内容为set陈丰
解释:此字符串传set陈丰五个字符,采用unicode编码。
0891固定格式不动,683108100005F0为短消息中心号码,
11固定格式不动代表PDU格式,
00代表是第几条短消息,
0B81固定格式不动,3109018759F1为目的号码,
00固定格式不动代表是短消息,
08代表8位unicode编码(中文必须用unicode编码),F0到F3为7编码,F4到F7为8位编码
A7代表此短消息在短消息中心存储的时间是24小时,最大FF为135周,
0A代表后有10个字节(有1个字节为01,2个为01,类推)
0065是s的unicode编码,0073是e的unicode编码,0074是t的unicode编码,
9648是陈的unicode编码,4E30是丰的unicode编码

0A后跟的就是所需发送的消息部分,全部采用unicode的编码。
unicode的编码转换可调用VB或VC中的函数直接得到。
at+cmgs=24中的24是14再加上消息长度10得出的.

2.USC2的文本方法
at+cmgf=1
at+csmp=??,??,??,8(问号代表自己根据需要选择合适的参数)
at+cmgs=手机号码(1390PQRABCD)
>00650073007496484E30
信息内容为set陈丰
当您用UCS2文本发送中文短消息时,要先将中文转成unicode编码,
再将中文短消息的unicode编码用文本方式发送.


B.编程例子:
Private Sub Command1_Click()
' 使用 COM3。

' 9600 波特,无奇偶校验,8 位数据,一个停止位。
MSComm1.Settings = "9600,N,8,1"
MSComm1.Handshaking = comRTS

' 打开端口。
' MSComm1.PortOpen = False
' MSComm1.PortOpen = True
' 将 at 命令送到调制解调器。
MSComm1.Output = "AT"
MSComm1.Output = Chr(13)
MSComm1.Output = "AT+CMGF=1"
MSComm1.Output = Chr(13)
MSComm1.Output = "AT+CMGS="
MSComm1.Output = Chr(34)
MSComm1.Output = "13901237885"
MSComm1.Output = Chr(34)
MSComm1.Output = Chr(13)
MSComm1.Output = "test OK "
MSComm1.Output = Chr(26)
End Sub

Private Sub Command3_Click()
MSComm1.CommPort = 2
MSComm1.PortOpen = True
End Sub

//将UNICODE转换中文
Public Function Unicode2AscII(ByVal s As String)
On Error Resume Next
Dim i As Integer
Dim r As String
For i = 1 To Len(s) Step 4
r = r + ChrB("&H" & Mid(s, i + 2, 2)) & ChrB("&H" & Mid(s, i, 2))
Next
Unicode2AscII = r
End Function

//将中文转换为UniCode,
function AnsiToUnicode(Ansi: string):string;
var
s:string;
i:integer;
j,k:string[2];
a:array [1..1000] of char;
begin
s:='';
StringToWideChar(Ansi,@(a[1]),500);
i:=1;
while ((a[i]<>#0) or (a[i+1]<>#0)) do begin
j:=IntToHex(Integer(a[i]),2);
k:=IntToHex(Integer(a[i+1]),2);
s:=s+k+j;
i:=i+2;
end;
Result:=s;
end;
__________________
[SIGPIC][/SIGPIC]
短信销售筱萱 当前离线   回复时引用此帖
旧 2012-01-13   #2 (permalink)
初级会员
 
OrnarpAcina 的头像
 
注册日期: 2011-12-16
住址: Ghana
帖子: 1
OrnarpAcina 正向着好的方向发展
发送 ICQ 消息给 OrnarpAcina
默认 Ear Defenders pro

This couple of hearing defenders is made for those that treasure their hearing but nevertheless adore audio — showing the AO Basic safety 90541 ear canal defenders/earmuffs by Peltor, part of its WorkTunes group of ear canal defenders. This kind of couple of ear canal defenders permits the user to protect his/her ears coming from loud, harmful appears (think power gear) whilst taking pleasure in music clearly and never have to compete with the actual loud seem resource.
Armed with a lengthy antenna, the actual 90541 ear defenders is able to in an electronic format hear the air very easily as well as allows for storage presets! Spot 2 decent AA batteries inside and you may use the stereo on these kinds of ear defenders whilst doing work for a couple of complete nights! Don’t like radio stations? No problem, the AO Security 90541 hearing defenders comes with an sound jack port to plug in another MP3 player. The speaker’s sound quality as well as audio tracks variety is fantastic.
Ear Defenders
__________________
Ear Defenders
OrnarpAcina 当前离线   回复时引用此帖
旧 2012-02-13   #3 (permalink)
初级会员
 
注册日期: 2011-12-09
住址: Germany
帖子: 1
AppopyifyGevy 正向着好的方向发展
发送 ICQ 消息给 AppopyifyGevy 发送 Skype™ 消息给 AppopyifyGevy
默认 Metal Roofing Colors In Canada

The Fordyce bathhouse is the most elaborate and was the most expensive of the bathhouses in Hot Springs, Arkansas, the cost including fixtures and furniture being 2,749.55 US. It was closed on June 29, 1962, the first of the Row establishments to fall victim to the decline in popularity of therapeutic bathing. Fordyce Bathhouse has served as the park visitor center since 1989.
metal roofing colors for houses
AppopyifyGevy 当前离线   回复时引用此帖
旧 2012-03-26   #4 (permalink)
初级会员
 
注册日期: 2010-08-28
住址: of
帖子: 1
WEganiscz 正向着好的方向发展
默认 how to unlocked iphone or how to jailbreak unlock iphone 4

Wednesday, October. Hunting for, as well as Experts Evening, that will be with Saturday November. 10. The initial normally requires numerous trips to be able to small sample all they iphone how to unlock
how to unlock iphone 4g 4.1
in safety just by figuring out how the fundamentals how to unlock iphone 4g 4.1
__________________
get rid of stress
handling stress
stress factors
WEganiscz 当前离线   回复时引用此帖
回复

书签


当前查看此主题的会员: 1 (0 位会员和 1 位游客)
 
主题工具
显示模式

发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
Trackbacks are 启用
Pingbacks are 启用
Refbacks are 启用



所有时间均为北京时间。现在的时间是 02:22


Powered by vBulletin® 版本 3.8.3
版权所有 ©2000 - 2021,Jelsoft Enterprises Ltd.