在wm5(vb2008)上通过应用发送短信 [英] Sending a SMS via app on wm5 (vb2008)

查看:71
本文介绍了在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 :

&amp;lt;pre&amp;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 = &quot;SMS-Aldi&quot;
    Private Sub Form1_Shown()
        Try
            client.Connect(&quot;192.168.120.100&quot;, 8000) &#39; hier die ip des servers eintragen.
            &#39; da dieser beim testen wohl lokal l&#228;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) &#39; das ist optional.
                streamw.Flush()

                t.Start()
            Else
                MessageBox.Show(&quot;Verbindung zum Server nicht m&#246;glich!&quot;)
                connected = False
                Application.Exit()

            End If
        Catch ex As Exception
            MessageBox.Show(&quot;Verbindung zum Server nicht m&#246;glich!&quot;)
            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() &#39;Lesen der Nummer
                streamed2 = streamr.ReadLine() &#39;Lesen des Textes
                Try
                    send_sms(streamed, streamed2) &#39;Senden der SMS
                    streamw.WriteLine(&quot;SMS wurde gesendet.&quot;) &#39;Antwort
                Catch
                    streamw.WriteLine(&quot;SMS senden fehlgeschlagen.&quot;) &#39;antwort
                End Try
            Catch
                MessageBox.Show(&quot;Verbindung zum Server nicht m&#246;glich!&quot;)
                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(&quot;Sending SMS: &quot; + nummer + &quot; &quot; + 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆