我需要一些想法(一些代码)来使用在Visual Basic 2010中开发的Windows应用程序在手机上实现短信发送。
我已经完成了电子邮件发送,但我不知道短信发送。
我已经使用 PHP 中的免费 API 完成了短信发送。但在 vb.net 中,我想在没有 API 的情况下做到这一点。(我想将我的手机连接到我的应用程序)
所以任何知识渊博的评论对我来说都会有很大的帮助......谢谢。
我需要一些想法(一些代码)来使用在Visual Basic 2010中开发的Windows应用程序在手机上实现短信发送。
我已经完成了电子邮件发送,但我不知道短信发送。
我已经使用 PHP 中的免费 API 完成了短信发送。但在 vb.net 中,我想在没有 API 的情况下做到这一点。(我想将我的手机连接到我的应用程序)
所以任何知识渊博的评论对我来说都会有很大的帮助......谢谢。
不确定我是否完全理解你的意思。但我认为您只是想在您的 VB .Net 应用程序中发送一条 SMS 消息。例如,我认为您要问的是如何将 SMS 消息从您的 VB .Net 应用程序发送到另一个电话号码。如果是这种情况,您应该像使用 VB .Net 发送电子邮件一样使用 SMS 网关。https://en.wikipedia.org/wiki/List_of_SMS_gateways
请记住,只能存在一个电话号码,因此向 8005551212@vzwpix.com 和 8005551212@pm.sprint.com 发送短信只会起作用。只会收到一条消息,因为其他 SMS 网关没有它的号码。因此,尝试创建所有 SMS 网关的列表并让用户输入他们的号码,然后使用用户输入的 number@gateway.com 发送消息将起作用。
'Now lets test the E-Mail functionality on our phone gap site. This section does just that.
Dim email As New MailMessage
Dim mailfrom As String
Dim mailto As String
mailfrom = lblAddress.Text
mailto = tbNumber.Text
email.To.Add(mailto)
email.From = New MailAddress(mailfrom)
email.Body = tbmsgBody.Text
Dim sendserver As String
sendserver = lblSMTP.Text
Dim SMTP As New SmtpClient(sendserver)
Dim username As String
Dim password As String
username = lblUName.Text
password = lblPW.Text
If lblSSL.Text = "Yes" Then
SMTP.EnableSsl = True
Else : SMTP.EnableSsl = False
End If
SMTP.Credentials = New System.Net.NetworkCredential(username, password)
Dim portnum As String
portnum = lblPort.Text
SMTP.Port = portnum
SMTP.Send(email)
MessageBox.Show("Message Sent")
ElseIf cbAction.Visible = True And cbAction.Text = "Send" And tbSubject.Visible = False Then
'The idea behind this section is mainly to use the SMS Gateways and using the same E-Mail Form. Since their will only always be just one phone. We can try to send the same message to all of of the SMS gateways for that number. Obviously only one message will ever be recieved and the sender of the message will get a whole bunch of delivery failure messages. But at least one will get to the actual phone number.
Dim email As New MailMessage
Dim mailfrom As String
Dim mailto As String
mailfrom = lblAddress.Text
mailto = tbNumber.Text
'Now lets add our SMS Gateways
'Since this is a SMS and MMS portion their will be no need to add a subject feild.
email.Bcc.Add(mailto + "@myboostmobile.com")
email.Bcc.Add(mailto + "@vtext.com")
email.Bcc.Add(mailto + "@sms.airfiremobile.com")
email.Bcc.Add(mailto + "@msg.acsalaska.com")
email.Bcc.Add(mailto + "@sms.alltelwireless.com")
email.Bcc.Add(mailto + "@mms.alltelwireless.com")
email.Bcc.Add(mailto + "@message.Alltel.com")
email.Bcc.Add(mailto + "@text.wireless.alltel.com")
email.Bcc.Add(mailto + "@mms.alltel.net")
email.Bcc.Add(mailto + "@paging.acswireless.com")
email.Bcc.Add(mailto + "@txt.att.net")
email.Bcc.Add(mailto + "@mmode.com")
email.Bcc.Add(mailto + "@mms.att.net")
email.Bcc.Add(mailto + "@txt.att.net")
email.Bcc.Add(mailto + "@cingularme.com")
email.Bcc.Add(mailto + "@mobile.mycingular.com")
email.Bcc.Add(mailto + "@page.att.net")
email.Bcc.Add(mailto + "@sms.smartmessagingsuite.com")
email.Bcc.Add(mailto + "@bellsouth.cl")
email.Bcc.Add(mailto + "@sms.bluecell.com")
email.Bcc.Add(mailto + "@mms.myblueworks.com")
email.Bcc.Add(mailto + "@cellcom.quiktxt.com")
email.Bcc.Add(mailto + "@csouth1.com")
email.Bcc.Add(mailto + "@cwemail.com")
email.Bcc.Add(mailto + "@sms.cvalley.net")
email.Bcc.Add(mailto + "@cingular.com")
email.Bcc.Add(mailto + "@cingular.com")
email.Bcc.Add(mailto + "@mobile.mycingular.com")
email.Bcc.Add(mailto + "@cingulartext.com")
email.Bcc.Add(mailto + "@sms.cleartalk.us")
email.Bcc.Add(mailto + "@sms.mycricket.com")
email.Bcc.Add(mailto + "@mms.mycricket.com")
email.Bcc.Add(mailto + "@cspire1.com")
email.Bcc.Add(mailto + "@sms.edgewireless.com")
email.Bcc.Add(mailto + "@SMS.elementmobile.net")
email.Bcc.Add(mailto + "@mobile.gci.net")
email.Bcc.Add(mailto + "@gscsms.com")
email.Bcc.Add(mailto + "@hawaii.sprintpcs.com")
email.Bcc.Add(mailto + "@myhelio.com")
email.Bcc.Add(mailto + "@iwirelesshometext.com")
email.Bcc.Add(mailto + "@mobile.kajeet.net")
email.Bcc.Add(mailto + "@text.longlines.com")
email.Bcc.Add(mailto + "@mymetropcs.com")
email.Bcc.Add(mailto + "@messaging.sprintpcs.com")
email.Bcc.Add(mailto + "@pm.sprint.com")
email.Bcc.Add(mailto + "@messaging.nextel.com")
email.Bcc.Add(mailto + "@page.nextel.com")
email.Bcc.Add(mailto + "@tmomail.net")
email.From = New MailAddress(mailfrom)
email.Subject = tbSubject.Text
email.Body = tbmsgBody.Text
Dim sendserver As String
sendserver = lblSMTP.Text
Dim SMTP As New SmtpClient(sendserver)
Dim username As String
Dim password As String
username = lblUName.Text
password = lblPW.Text
If lblSSL.Text = "Yes" Then
SMTP.EnableSsl = True
Else : SMTP.EnableSsl = False
End If
SMTP.Credentials = New System.Net.NetworkCredential(username, password)
Dim portnum As String
portnum = lblPort.Text
SMTP.Port = portnum
SMTP.Send(email)
MessageBox.Show("Message Sent")
您可以在https://github.com/LinuxPhreak/PhoneGap-Emulators查看整个源代码