通过手机c#通过PC发送消息 [英] Send Messages Through PC via mobile c#

查看:116
本文介绍了通过手机c#通过PC发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款应用。是否有任何方法通过将命令发送到连接的移动设备发送短信到其他移动设备发送短信。我正在Windows窗体上工作任何帮助将不胜感激。



参考此图片 http://imageshack.com/a/img199/9882/jeof.jpg [ ^ ]

I am developing an app. is there any way to send SMS to other mobile by pushing command to the connected mobile to pc to send SMS. I am working on windows form any help will be appreciated.

refer this image http://imageshack.com/a/img199/9882/jeof.jpg[^]

推荐答案

Google是你的朋友:好好经常拜访他。他可以比在这里发布问题更快地回答问题......



快速搜索超过100,000次点击:通过手机发送短信c# [ ^ ]



将来,请尝试自己做至少基础研究,不要浪费你的时间或我们的时间。
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search gave over 100,000 hits: Send SMS via mobile c#[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.


使用此代码我已经使用Dongle发送短信工作



Use This Code I have Used Dongle To Send Sms Its Working

using System;
using System.Collections.Generic;
using System.Threading;
using System.IO.Ports;
using System.Windows.Forms;
using System.Management;
using System.Management.Instrumentation;

namespace gi
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SerialPort s;
        private void button1_Click(object sender, EventArgs e)
        {

            string comport = cboPorts.Text;
            GetPort(comport);
        }
        public void GetPort(string comport)
        {
           // if (this.s == null)
            {
                this.s = new SerialPort();
                this.s.PortName = comport;
                this.s.Open();
                this.s.BaudRate = 9600;
                this.s.Parity = Parity.None;
                this.s.DataBits = 8;
                this.s.StopBits = StopBits.One;
                //this.s.Handshake = Handshake.RequestToSend;
                this.s.DtrEnable = true;
                this.s.RtsEnable = true;
                //this.s.RtsEnable = true;
                this.s.NewLine = System.Environment.NewLine;
                this.s.WriteLine("AT" + (char)(13));
                //string tt = s.ReadLine();
               // if(s.ReadLine()!="AT/r/r")
                {
                    Thread.Sleep(2000);
                    this.s.WriteLine("AT+CMGF=1" + (char)(13));
                    Thread.Sleep(3000);
                    this.s.WriteLine("AT+CMGS=\"" + 8050398620 + "\"");
                    Thread.Sleep(5000);
                    this.s.WriteLine(">" + "le" + (char)(26));
                    this.s.Close();
                }
                else
                {
                    MessageBox.Show("Dervice Nt");
                }
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            string[] ports = SerialPort.GetPortNames();


            foreach (string port in ports)
            {
                cboPorts.Items.Add(port);
            }
        }
    }
}


这篇关于通过手机c#通过PC发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆