将短信从PC发送到移动 [英] Send Sms From PC to Mobile
本文介绍了将短信从PC发送到移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要制作asp.net项目&我想从我的页面发送短信。运行时没有错误,但短信不发送。请帮忙
I am going make asp.net project & I want to send Sms from my page. There is no error when it runs but sms not send. please help for that
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="SMS.aspx.vb" Inherits="Popup.SMS" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.IO.Ports
Public Class SMS
Inherits System.Web.UI.Page
Dim sp As New SerialPort()
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
sp.PortName = "COM3"
sp.Open()
Dim ph_no As String = [Char].ConvertFromUtf32(34) & TextBox1.Text & [Char].ConvertFromUtf32(34)
sp.Write("AT+CMGF=1" & [Char].ConvertFromUtf32(13))
sp.Write("AT+CMGF=" & ph_no & [Char].ConvertFromUtf32(13))
sp.Write(TextBox2.Text & [Char].ConvertFromUtf32(26) & [Char].ConvertFromUtf32(13))
sp.Close()
End Sub
End Class
推荐答案
只是l观看了这个视频。
这里有很好的解释...
http://www.youtube.com/watch?v=wtT1EvJT4kU [ ^ ]
Just look over this video.
here is very good explanation...
http://www.youtube.com/watch?v=wtT1EvJT4kU[^]
这篇关于将短信从PC发送到移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文