9Mcode comment |
 |
 |
|
|
|
 |
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
 |
กระทู้ #150 [Vb] (จาก IP: 203.185.129.244)
ใช้ VB6 เขียนติดต่อกับ มือถือ เพื่อส่ง sms
Sub Modem_Dial_Up() MSComm1.CommPort = 9 MSComm1.Settings = "9600,N,8,1" If Not MSComm1.PortOpen Then MSComm1.PortOpen = True MSComm1.Output = "AT+CSDH=1" & Chr$(13) MSComm1.Output = "AT+CSMP=17,167" & Chr$(13) MSComm1.Output = "AT+CMGF=1" & Chr$(13) MSComm1.Output = "AT+CMGS=" & Chr$(34) & "<เบอร์เครื่องปลายทาง>" & Chr$(34) & Chr$(13) MSComm1.Output = "Test" & Chr$(26) MSComm1.PortOpen = False End Sub
|
จากคุณ
:
sup98 [2006-01-13 19:19:33]
|
|
ความคิดเห็น #190 (จาก IP: 203.156.41.228)
พี่ครับ ถ้ามือถือผมเชื่อมต่อกับ pc ด้วย Bluetooth ผมจะสามารถใช้โค้ดของพี่ได้เปล่าครับ หรือจะมีวิธีเขียนต่างออกไปอีกแบบครับ |
จากคุณ
:
หนักใจ [2006-01-20 20:05:14]
|
 |
ความคิดเห็น #329 (จาก IP: 61.90.250.15)
พี่ครับ copy คำสั่งพวกนี้ไปไว้แล้ว ถ้าจะให้มันทำงาน จะทำการกดปุ่มยังไงครับ |
จากคุณ
:
king / king_nk@hotmail.com [2006-04-02 00:51:44]
|
 |
ความคิดเห็น #3891 (จาก IP: 124.121.8.148)
เขียนแบบนี้เรียกไม่ได้ใน nokia น่ะครับ วิธีที่ถูกต้องคือทดสอบใน hyperterminal ก่อนโดย port มือถือถ้าเป็น usb หรือ bluetooth คุณต้องติดตั้ง Nokia PC Sute แล้วระบบจะ create COM port มาให้เอง อาจจะเป็น COM3 , COM4 ... ต่อไปก็เปิด hyperterminal แล้วเลือก COM port ที่ต้องการ แล้วทำการเชื่อมต่อ จากนั้นพิมพ์ Command ดังนี้
AT ตรวจสอบอุปกรณ์ว่าพร้อมหรือไม่ enter OK <-- ผลที่ได้รับ AT-CMGF=1 นี่คือตั้งเป็น Text mode OK <-- ผลที่ได้รับ AT-CMGS="เบอร์โทรที่ต้องการส่ง" enter > ข้อความ แล้วตามด้วย Ctrl + z
เท่านี้ก็จะส่งข้อความเข้ามือถือได้แล้ว ส่วนวิธีวน VB มีดังนี้ ให้ไปสร้าง Mscomm น่ะครับ แล้ว copy code นี้ไป
'------------------------------------- ' Set up the communications port MSComm1.CommPort = 1 ' Com Port 1
' Set for 9600 baud, no parity, 8 data, and 1 stop bit. MSComm1.Settings = "9600,N,8,1"
' Tell the control to read entire buffer when Input is used MSComm1.InputLen = 0
' Open the port MSComm1.PortOpen = True
' Send an 'AT' command to the phone MSComm1.Output = "AT" & Chr$(13) & Chr(10) ' The phone will respond with an 'OK'
' Set up the phone for a text message MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10) ' The phone will respond with an 'OK'
' Prep for SMS, give destination type and destination address. ' Enter the destination type and destination address to prep for SMS ' e.g. AT+CMGS="+2145551212",129 MSComm1.Output = "AT+CMGS= " & Chr(34) & _ "+2145551212" & Chr(34) & ",129" & Chr$(13) & Chr(10) ' The phone will return a'>' prompt, and await entry of the SMS message text.
' Now send the text to the phone and terminate with (Ctrl-Z) MSComm1.Output = "This is a test. WOW! " ' The phone will respond with a conformation containing ' the 'message reference number' eg. +CMGS:
' Close the port MSComm1.PortOpen = False '-----------------------------------
ปัญญาจงเกิดแก่ท่านผู้มีความพยายาม ...เอก
|
จากคุณ
:
เอก pro_f@hotmail.com / pro_f@hotmail.com [2006-05-11 02:34:01]
|
 |
ความคิดเห็น #4773 (จาก IP: 124.121.5.128)
เพิ่มเติมน่ะครับคือคุณต้องเพิ่มฟังก์ชั่น Sleep เพื่อหน่วงเวลการส่งข้อมูลกลับมาของ AT commnad ซึ่งตรงนี้คือหัวใจหลักสำคัญมาก เมื่อเราแทรกโค้ด Sleep แล้วจะได้โค้ดเต็มๆดังนี้
'--------------- SMS AT command -------- Option Explicit
' เรียก API ทำงานเพื่อใช้ function Sleep Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub cmdSend_Click() Dim dteElapsed As Variant Dim strInput As Variant
' เปิด Com port ที่ modem มือถือใช้อยู่ ' ตอนลง driver ของมือถือมันจะ create ให้ MSComm1.PortOpen = True
' ตั้ง baud เป็น 9600 , no parity, 8 data, ง ' และ 1 stop bit. MSComm1.Settings = "9600,N,8,1"
' อ่าน buffer ทั้งหมดที่มีเข้ามา MSComm1.InputLen = 0
' ส่ง AT ไปถามว่าการเชื่อมต่อพร้อมหรือไม่ MSComm1.Output = "AT" & Chr$(13) & Chr(10) ' Sleep (1000)
' The phone will respond with an 'OK' ' Set up the phone for a text message MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
' มือถือจะส่งว่า 'OK' กลับมาถ้าพร้อม Sleep (1000) MSComm1.Output = "AT+CMGS= " & Chr(34) & "ใส่เบอร์โทรเช่น018808049" & Chr(34) & ",129" & Chr$(13) & Chr(10) ' มือถือจะส่ง '>' prompt กลับมาว่าพร้อมรับ ' ข้อความที่จะส่งไป Sleep (1000)
' เราก็ใส่ข้อความที่จะส่งเข้าไป ' แล้วตามด้วย (Ctrl-Z) ที่แทนด้วย Chr(26) MSComm1.Output = "ข้อความที่ส่ง" & Chr(26)
' หน่วงเวลารอการตอบกลับ Sleep (2000)
' เมื่อเสร็จแล้วก็คืน COM port กลับให้ระบบ MSComm1.PortOpen = False End Sub
'--------------------------------------------
ปัญญาจงเกิดแก่ท่านผู้มีความพยายาม .. เอก
|
จากคุณ
:
เอก pro_f@hotmail.com / pro_f@hotmail.com [2006-05-13 22:12:34]
|
 |
ความคิดเห็น #7935 (จาก IP: 58.64.105.146)
แล้ว code นี้จะส่งจากโทรศัพท์บ้านเข้ามือถือได้มัยครับ ผมลองตั้งให้ส่งเข้ามือถือตัวเองและรันโปรแกรมดูแล้วแต่ไม่มีผลอะไรเกิดขึ้นเลย |
จากคุณ
:
Kenn [2006-06-03 13:57:14]
|
 |
ความคิดเห็น #13862 (จาก IP: 161.246.1.32)
?????? แล้วถ้าต้องการเขียนใน Delphi ล่ะครับ อยากทราบว่าถ้าจะส่ง sms (AT+CMGS) ตัว ctrl-z ผมจะต้องเขียน code อย่างไรครับ ขอบคุณครับ |
จากคุณ
:
Pop [2006-07-29 17:00:33]
|
 |
ความคิดเห็น #25542 (จาก IP: 58.8.145.133)
ผมเคยโดนคนชื่อเอก pro_f@hotmail.com หลอก เสียเงินไปเกือบหมื่น แต่ไม่ได้งานอะไรกลับมาเลยเจ็บใจมาก มันไว้ผมสั้น หัวมันจะล้านนิดๆ ผิวขาว พูดจาเหมือนว่ามีความรู้มากมาย สามารถทำงานเสร็จตามทันเวลาแน่นอน แต่มันจะขอให้เราจ่ายก่อนครึ่งนึงครับ พอสักพักมันก้อจะขอขึ้นราคา และบอกเราว่างานที่จ้างมามันยากมากขอขึ้นราคาอีกหน่อย สุดท้ายมันก้อจะไม่รับโทรศัพท์เราอีกเลย พยายามเลี่ยงบอกว่าติดธุระ งานเยอะ โปรดระวังด้วยนะครับ ไม่อยากให้มีใครโดนเหมือนผมอีก เรามาช่วยกันกำจัดคนเลวๆออกไปจากสังคมกันเถอะครับ คนเลวที่หาแดกบนความทุกข์ของคนอื่นแบบมันควรจะติดคุกดีที่สุด |
จากคุณ
:
tum ผู้เสียหายอีกคนของไอ้เอก [2007-05-22 16:55:39]
|
 |
ความคิดเห็น #26032 (จาก IP: 203.130.145.67)
ไอ่เอก มะรึงต๊ายๆๆๆๆๆๆๆๆ |
จากคุณ
:
โท [2007-09-19 13:30:31]
|
 |
ความคิดเห็น #26700 (จาก IP: 124.157.168.220)
เขียน Code อย่างไร กดปุ่มแล้ว ไปควบคุมโทรศัพท์ให้ดัง แทนการส่ง SMS |
จากคุณ
:
ผู้กำลังมีปัญหา / umchum_1@hotmail.com [2008-04-23 16:53:28]
|
 |
ความคิดเห็น #26997 (จาก IP: 91.98.37.101)
hi i check and use your above code i simulate them in c++ and compile with g++ at the linux but don't work and those code have some error. i want to create a programm with c or c++ for send sms from linux please help me |
จากคุณ
:
mohammad / Send SMS from Linux [2008-08-14 13:51:52]
|
 |
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
|
|
|
|