using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO.Ports;
using System.IO;
using System.Threading;
using System.Transactions;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
SerialPort port = new SerialPort("COM2", 9600, Parity.None, 8, StopBits.One);
protected void Page_Load(object sender, EventArgs e)
{
port.RtsEnable = true;
port.DtrEnable = true;
port.Open();
port.Write("AT+CMGF=1" + "\r\n");
Thread.Sleep(2000);
string I = port.ReadExisting().ToString();
Thread.Sleep(2000);
port.Write("AT+CNMI=1,3,2,1" + "\r\n");
Thread.Sleep(2000);
string L = port.ReadExisting().ToString();
Thread.Sleep(2000);
port.Write("AT+CMGR=1" + "\r\n");
Thread.Sleep(2000);
string msg = port.ReadExisting().ToString();
Thread.Sleep(2000);
port.Write("AT+CMGS="+"+919961365059"+""+"\r\n" + "hai how are u" + "\r\n");
Thread.Sleep(2000);
string res = port.ReadExisting().ToString();
Thread.Sleep(2000);
int num = Convert.ToInt32("26");
string st = num.ToString("X");
port.Write(st+ "\r\n");
Thread.Sleep(2000);
string message = port.ReadExisting().ToString();
string u = b.Substring(0, message.IndexOf("\r\n"));
port.Close();
}
}
ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms.
Subscribe to:
Post Comments (Atom)
Using Authorization with Swagger in ASP.NET Core
Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models { ...
-
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.D...
-
<ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}"> <Borde...
-
<?xml version="1.0" encoding="utf-8"?> <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting...
No comments:
Post a Comment