简体   繁体   English

是否可以通过智能手机从Visual Basic 2013发送短信?

[英]Is it possible to send an SMS from Visual Basic 2013 through my smartphone?

I would like to send an SMS from a VB2013 application with my smartphone programmatically. 我想通过智能手机通过VB2013应用程序发送短信。 I have already found several solutions how to solve this with Windows Phone (Outlook-Windows Phone). 我已经找到了几种解决方案,如何使用Windows Phone(Outlook-Windows Phone)解决此问题。 The only problem is, that I have an android device. 唯一的问题是,我有一个android设备。 So my question is, do you know any idea or solution that supports android? 所以我的问题是,您知道支持android的任何想法或解决方案吗?

The workflow that I want to implement is the following: 我要实现的工作流程如下:

  • The user types into a textbox the phone number and the text on a VB2013 app. 用户在文本框中键入电话号码和VB2013应用程序上的文本。
  • He/She clicks to the "Send" button, and somehow it sends an SMS from the android phone to the phone number that is given by himself/herself. 他/她单击“发送”按钮,然后以某种方式将短信从android手机发送到他/她自己给出的电话号码。

Regards, 问候,

Roland 罗兰

I would say that this is not possible directly. 我会说这不可能直接实现。

The problem you already found is that your Smartphone is Android and Vb.Net needs a .net Framework with which it works. 您已经发现的问题是您的智能手机是Android,而Vb.Net需要使用.net Framework才能工作。

So the possibility I see is to get a connection via USB port to your device and send some specific commands to make your smartphone send SMS. 因此,我看到的可能性是通过USB端口连接到您的设备,并发送一些特定命令以使智能手机发送短信。 To do this you have to use a serial port from my point of view. 从我的角度来看,您必须使用串行端口。

This question has already been asked, so please take a look at: 这个问题已经被问到了,所以请看一下:

Sending SMS with Vb.net 用Vb.net发送短信

The .Net framework does not natively run on Android, so no this is not possible. .Net框架本身无法在Android上运行,因此不可能。

However, the Xamarin framework allows you to write android apps in Visual Studio. 但是, Xamarin框架允许您在Visual Studio中编写android应用。

Specifically towards your question, Xamarin has an SmsManager class that allows you to send Sms messages, the documentation can be found here . 专门针对您的问题,Xamarin具有一个SmsManager类,该类允许您发送Sms消息,可在此处找到文档。

Hope this helps. 希望这可以帮助。

There are several different ways to do this, but the best one is use an api like Twilio . 有几种不同的方法可以做到这一点,但是最好的方法是使用Twilio这样的api。 You can literally send an sms with one line of code. 您可以使用一行代码从字面上发送短信。 They have a nuget package which would get you up and running even faster. 他们有一个nuget软件包 ,可以使您更快地启动和运行。

Another is to use carrier mail. 另一个是使用邮递员邮件。 You have to know the users carrier and then you can create an email address that sends as a text ie. 您必须了解用户载体,然后才能创建以文本形式发送的电子邮件地址,即。 1231234123@txt.att.net. 1231234123@txt.att.net。 The issue with using cellular carrier email is that spammers often use this and one minute there is a message from your site and then next is spam, since it will be coming from the same carrier.email address. 使用蜂窝运营商电子邮件的问题在于,垃圾邮件发送者经常使用该电子邮件,一分钟后您的站点就会收到一条消息,然后是垃圾邮件,因为它来自同一运营商。电子邮件地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM