Click here to Skip to main content
15,038,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

i want send sms via C# and huawei 303

the huawei 303 not connect as the COM port.

when i connect it to my computer new network interface and web page appear and i can manage and send sms with http web site like ADSL modem in address ...

no COM port show on device manager .. only one new network interface ...

can i send SMS via C# with this modem ?
Updated 11-Jan-21 4:13am

If you cn send SMS using http interface, than what's the problem?
Use Fiddler or IE (10+) Developer toolbar to trach http traffic between your browser and the device. You can than mimic the same actions using WebRequest[^] or HttpClient[^].
using System;
using System.Net.Http;
using System.Windows;
using System.Net;
using System.Text; // for class Encoding
using System.IO; // for StreamReader

namespace WpfSMShilink
    public partial class MainWindow : Window
        public MainWindow()
        private void SendSMS()
          DateTime Fecha = DateTime.Now;
            var SMS = $"<?xml version='1.0' encoding='UTF-8'?><request><Index>-1</Index><Phones><Phone>";
            SMS += Telefono.Text;
            SMS += "</Phone></Phones><Sca></Sca><Content>";
            SMS += Mensaje.Text;
            SMS += "</Content><Length>";
            SMS += Mensaje.Text.Length;
            SMS += "</Length><Reserved >1</Reserved><Date>";
            SMS += Fecha.ToString("yyyy-MM-dd HH:mm:ss");
            SMS += "</Date></request>";

            var baseAddress = new Uri("");
            using (var handler = new HttpClientHandler { UseCookies = false })
                using (var client = new HttpClient(handler) { BaseAddress = baseAddress })
                    var request = (HttpWebRequest)WebRequest.Create("");
                    var postData = SMS;
                    var data = Encoding.ASCII.GetBytes(postData);

                    request.Method = "POST";
                    request.KeepAlive = true;
                    request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
                    request.ContentLength = data.Length;
                    request.Accept = "*/*";
                    using (var stream = request.GetRequestStream())
                        stream.Write(data, 0, data.Length);

                    var response = (HttpWebResponse)request.GetResponse();
                    var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();

        private void BtnSend_Click(object sender, RoutedEventArgs e)
CHill60 11-Jan-21 12:42pm
An uncommented code dump is not a solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900