<%@ 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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)