在wm5(vb2008)上通过应用发送短信 [英] Sending a SMS via app on wm5 (vb2008)
本文介绍了在wm5(vb2008)上通过应用发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿,
我编写了一个程序,将消息发送到Windows Phone,现在我想知道如何通过此应用程序发送短信.
它应该发送一些超过16位的短信.
:laugh:; P
有人可以帮我吗?
这是程序的链接:
http://www.deutschedetektive.de/MyProjects/PC_SMS_PPC.zip
Hey,
I wrote a programme that transmits a message to my windows phone and now I want to know how i can send an sms via this app.
It should send some sms with more than 16 bits.
:laugh: ;P
can someone help me ??
here''s the link to the programme :
http://www.deutschedetektive.de/MyProjects/PC_SMS_PPC.zip
推荐答案
好,下面是代码片段:
ok, here are the code fragments :
&lt;pre&gt;<
Imports System.Net.Sockets
Imports System.IO
Public Class Form1
Private stream As NetworkStream
Private streamw As StreamWriter
Private streamr As StreamReader
Private client As New TcpClient
Private connected As Boolean = True
Private t As New Threading.Thread(AddressOf Listen)
Private Delegate Sub DAddItem(ByVal s As String)
Private nick As String = "SMS-Aldi"
Private Sub Form1_Shown()
Try
client.Connect("192.168.120.100", 8000) ' hier die ip des servers eintragen.
' da dieser beim testen wohl lokal läuft, hier die loopback-ip 127.0.0.1.
If connected = True Then
stream = client.GetStream
streamw = New StreamWriter(stream)
streamr = New StreamReader(stream)
streamw.WriteLine(nick) ' das ist optional.
streamw.Flush()
t.Start()
Else
MessageBox.Show("Verbindung zum Server nicht möglich!")
connected = False
Application.Exit()
End If
Catch ex As Exception
MessageBox.Show("Verbindung zum Server nicht möglich!")
connected = False
Application.Exit()
End Try
End Sub
Private Sub Listen()
Dim streamed As String
Dim streamed2 As String
While connected = True
Try
streamed = streamr.ReadLine() 'Lesen der Nummer
streamed2 = streamr.ReadLine() 'Lesen des Textes
Try
send_sms(streamed, streamed2) 'Senden der SMS
streamw.WriteLine("SMS wurde gesendet.") 'Antwort
Catch
streamw.WriteLine("SMS senden fehlgeschlagen.") 'antwort
End Try
Catch
MessageBox.Show("Verbindung zum Server nicht möglich!")
connected = False
Application.Exit()
End Try
End While
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Sub send_sms(ByVal nummer As String, ByVal text As String)
MsgBox("Sending SMS: " + nummer + " " + text)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1_Shown()
End Sub
End Class</pre>
</pre>
please only edit the sub send_sms()
it also should detect if a message was recieved ok ??
AND: I'M NOT A HACKER WHICH POSTS ANY VIRUSSES !!!!
这篇关于在wm5(vb2008)上通过应用发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文