如何使用C#从Android手机发送批量短信? [英] How to send bulk sms from android mobile using C# ?

查看:170
本文介绍了如何使用C#从Android手机发送批量短信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用c#代码从Android手机发送短信。我有运行代码通过GSM调制解调器发送短信。但它无法连接任何Android手机。请发送代码。



我尝试过:



我已成功尝试通过GSM调制解调器发送短信。但我需要从任何Android手机发送短信。

I need send SMS from android mobile using c# code. i have running code for sending SMS through GSM modem. But it cannot connect any android mobiles. please send code for that.

What I have tried:

I have successfully tried to send SMS through only GSM modem.But I need to send SMS from Any Android mobile.

推荐答案

检查链接下方并让我知道。 />
使用Android手机的短信网关 [ ^ ]
Check Below Link and let me know.
SMS Gateway using Android Phone[^]


如果您有C#的代码库,它通常会作为服务或API公开,可以侦听来自网络上其他设备的请求。



您可以看到很多资源,以了解如何将Android设备与用.NET编写的服务连接起来。最明显的方法是公开Socket对象并让Android设备通过本机套接字进行通信。



更好,更简单的方法是让ASP.NET API监听请求,然后从该GSM调制解调器广播消息。

If you have a code base for C#, it mostly would be exposed as a service or an API that can listen to requests from other devices on the network.

There are a lot of resources that you can see to understand how to connect Android device with a service written in .NET. Most obvious way is to expose Socket objects and have Android device communicate over native sockets.

An even better and easy way is to have an ASP.NET API listen to requests, and then broadcast the messages from that GSM modem.
// Send a request to this action.
[Route("/api/Send/{message}")]
public string SendMessages(string message) {
   // Connect to GSM modem and send to the network.
}



这个简单的API可让您通过HTTP客户端对象将任何设备(不仅仅是任何Android设备)连接到此服务。



问题是你不需要搜索在android中从c#发送短信,你只需要搜索用.net服务连接android。 Google会为您提供大量有用的资源供您查看;代码示例,文章等。



另请阅读我的旧答案:

C#窗体连接到Android应用程序 [ ^ ]

< a href =https://www.codeproject.com/Answers/873245/Interaction-between-Csharp-windows-form-and-Java-a#answer1> C#windows表单与Java android应用程序之间的交互 [ ^ ]

C#windows表单连接到Android应用程序 [ ^ ]

Android TCP客户端和visual studio C#服务器 [ ^ ]

如何从我的asp.net网站发送数据到Android应用程序? [ ^ ]

如何从android调用web api? [ ^ ]

如何通过USB线从Android应用程序到c#app进行数据传输? [ ^ ]


This simple API will let you connect any device (not just any Android device), to this service via an HTTP client object.

The thing is you do not need to search for "send sms from c# in android", you just need to search for "connect android with .net service". Google would yield a lot of useful resources for you to take a look at; code samples, articles etc.

Also read these older answers of mine too:
C# windows form to connect to android app[^]
Interaction between C# windows form and Java android app[^]
C# windows form to connect to android app[^]
Android TCP client and visual studio C# server[^]
How to send data from my asp.net website to android app ?[^]
How to call web api from android?[^]
How can I do data transfer from android app to c# app via USB cable?[^]


这篇关于如何使用C#从Android手机发送批量短信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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