Is there a google voice api for sending text messages? [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Does anyone know of any working gvoice api? I have found this project:
http://sourceforge.net/projects/gvoicedotnet/
but the login appears to no longer work since the url changed some months ago.
Does anyone have a good question for sending out text messages to users of my website?

I found one: SharpGoogleVoice.
https://bitbucket.org/jitbit/sharpgooglevoice/downloads
It only has text messaging support, but it works well and looks like good work.

Self-promotion: my API, SharpVoice, works/worked quite well (hasn't been tested in some time): https://github.com/descention/sharp-voice
Voice voiceConnection = new Voice(loginEmail, loginPassword);
string response = voiceConnection.SendSMS(smsToPhoneNumber, smsMsgBody);

What you need is an SMS gateway that will let you send out text messages via an API. A quick Google search yields Zeep Mobile, which lets developers send SMS text messages for free from their application.
Because it's free, there may very well be some restrictions, but if you architect your app correctly using a strategy or adapter pattern then you should be able to replace this module later on down the road with something more advanced based on the needs of your application.
The primary restriction on the free plan is that it's ad-supported. This may very well be ok for you during initial development and testing, but your production users will likely find this to be a significant problem in using your service. Zeep does have a paid plan that eliminates the ads, and there are of course countless other SMS gateways that have API's that you can use for a fee.

You can get send messages with Twilio.
An example using the C# helper library:
https://www.twilio.com/docs/libraries/csharp
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/user/account
string AccountSid = "YOUR_ACCOUNT_SID";
string AuthToken = "YOUR_AUTH_TOKEN";
var twilio = new TwilioRestClient(AccountSid, AuthToken);
var message = twilio.SendMessage(
"+15017250604", "+15558675309",
"Hey Kyle! Glad you asked this question.",
new string[] { "http://farm2.static.flickr.com/1075/1404618563_3ed9a44a3a.jpg" }
);
Console.WriteLine(message.Sid);
}
}

Related

Auto testing for Microsoft Bot Framework [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm working now on my first bot with Microsoft Bot Framework, with ASP.NET.
After manually testing with the bot emulator, I'm looking for the best method to create automatic testing for the bot.
Considering two problems:
What is the best tool to automate such tests?
What is the best method to test a dialog that can return different answers to the same input?
One alternative is doing functional tests using DirectLine. The caveat is that the bot needs to be hosted but it's powerfull. Check out the AzureBot tests project to see how this works.
Another alternative, is doing what the BotFramework team is doing for some of their unit tests.
If you are using Dialogs, you can take a look to the EchoBot unit tests as they are simple to follow.
If you are using Chain, then take a look to how their are using the AssertScriptAsync method.
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L360
https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L538
If you are looking for a way to mock up Luis Service, see this.
You may want to consider Selenium. Selenium is web browser automation software allowing you to write tests that programmatically read and write to the DOM of a web page. With a Selenium script you can:
login on any channel that provides a web client (and most of them do: WebChat, Telegram, Skype, Facebook, for example)
start a conversation with your bot
perform operations such as post a message to the chat and wait for a reply
test whether the reply is what you expected.
For automated testing of bots in Node.js, using ConsoleConnector in the same way as the tests in BotBuilder on GitHub works well, e.g. take a look at https://github.com/Microsoft/BotBuilder/blob/master/Node/core/tests/localization.js:
var assert = require('assert');
var builder = require('../');
describe('localization', function() {
this.timeout(5000);
it('should return localized prompt when found', function (done) {
var connector = new builder.ConsoleConnector();
var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session, args) {
session.send('id1');
});
bot.on('send', function (message) {
assert(message.text === 'index-en1');
done();
});
connector.processMessage('test');
});
...etc...

C# Fetch certain email with subject [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
How can I fetch an email, that has the subject I'm looking for in Hotmail using C#.
e.g. I want the emails(body/message) that has the word "Yahoo" in its subject.
Tried using many examples online but they weren't really clear. Thanks
You can connect to your hotmail account using the OpenPop.Net open source library. It has a lot of useful methods to communicate with a POP3 server. There is a lot of useful examples online. A simple code to connect to the POP3 server could work look this:
using(Pop3Client client = new Pop3Client())
{
client.Connect(hotmailHostName, pop3Port, useSsl);
client.Authenticate(username, password, AuthenticationMethod.UsernameAndPassword);
// And here you can use the client.GetMessage() method to get a desired message.
// You can iterate all the messages and check properties on each of them.
}
The hotmailHostName should be "pop3.live.com".
The pop3Port should be 995.
The useSsl should be true.

How to Monitor HTTP Requests Directly From C# Server Console? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
does anyone know how to get a C# server application running in the console to display HTTP requests from a client as shown in this image?
http://imgur.com/filhZJZ
Thanks in advance!
If all you want to do is spin up an HTTP server and write out requests to the console, it should be pretty easy to accomplish using OWIN and Katana. Just install the following NuGet packages:
Microsoft.Owin.Hosting
Microsoft.Owin.Host.HttpListener
And use something along the lines of the following:
public static class Program
{
private const string Url = "http://localhost:8080/";
public static void Main()
{
using (WebApp.Start(Url, ConfigureApplication))
{
Console.WriteLine("Listening at {0}", Url);
Console.ReadLine();
}
}
private static void ConfigureApplication(IAppBuilder app)
{
app.Use((ctx, next) =>
{
Console.WriteLine(
"Request \"{0}\" from: {1}:{2}",
ctx.Request.Path,
ctx.Request.RemoteIpAddress,
ctx.Request.RemotePort);
return next();
});
}
}
You can of course tweak the output to your liking, having access to the full request and respose objects.
It will give you something like this:
You can do this using System.Diagnostics Tracing in Web API. On the asp.net website, you'll be able to read a detailed article.
Another possibility is turning on the IIS logging and then read the logfiles. I'm not quite sure how this is done, it's just what I do on apache2/linux, where you can tail -f log. I read something about powershell equivalents, but not for consoleapps, so I think I would stick with the Tracing.
Edit: After some looking around on SO I found this similar question with relevant answers:
How do I see the raw HTTP request that the HttpWebRequest class sends?

Text Message Sending Free APIs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I wanted to know that are there any Free APIs available for message sending?
I actually wanted to send a message to minimum 50 people at a time via my application. Is there any Free API available for message sending?
I want to send messages to their cell Numbers.. Is there any API for sending text messages to Cell Numbers?
You can do that by sending to the email txt address, all cell phones have email addresses you can send to. Number#provider.
* AT&T – cellnumber#txt.att.net
* Verizon – cellnumber#vtext.com
* T-Mobile – cellnumber#tmomail.net
* Sprint PCS - cellnumber#messaging.sprintpcs.com
* Virgin Mobile – cellnumber#vmobl.com
* US Cellular – cellnumber#email.uscc.net
* Nextel - cellnumber#messaging.nextel.com
* Boost - cellnumber#myboostmobile.com
* Alltel – cellnumber#message.alltel.com
2 possible solutions are:
Include the addresses that you want to hide as BCc in the email
Create an email group on your mail server (containing all the individual email addresses) and use that email group address in your C# code
or do like this ...
using System.Net.Mail;
then further down your code...
MailMessage message = new MailMessage();
message.CC.Add("allemailgroup#yourdomain.com");
foreach (string recipient in recipients) // assuming recipients is a List<string>
{
message.Bcc.Add(recipient);
}
EDIT: there are three ways to send text messages to cell
Using a GSM modem: Better when one wants to implement offline
applications and a very small number of SMS go every minute, usually
few 10s.
Using web service: Better when it is an online application and a very
few number of SMS go every minute, usually few 10s.
Using endpoints given by service the provider: Better when the number
of SMS exceeds a few 100s per minute. Service provider demands a
commitment
I strongly recommend you pls go through this link for more information
of at least 100,000 SMS per month.

Free FTP Library [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Can you recommend a free FTP library(class) for C#.
The class has to be well written, and have good performance.
You may consider FluentFTP, previously known as System.Net.FtpClient.
It is released under The MIT License and available on NuGet (FluentFTP).
Why don't you use the libraries that come with the .NET framework: http://msdn.microsoft.com/en-us/library/ms229718.aspx?
EDIT: 2019 April by https://stackoverflow.com/users/1527/
This answer is no longer valid. Other answers are endorsed by Microsoft.
They were designed by Microsoft who no longer recommend that they should be used:
We don't recommend that you use the FtpWebRequest class for new development. For more information and alternatives to FtpWebRequest, see WebRequest shouldn't be used on GitHub. (https://learn.microsoft.com/en-us/dotnet/api/system.net.ftpwebrequest?view=netframework-4.7.2)
The 'WebRequest shouldn't be used' page in turn points to this question as the definitive list of libraries!
edtFTPnet is a free, fast, open source FTP library for .NET, written in C#.
I like Alex FTPS Client which is written by a Microsoft MVP name Alex Pilotti. It's a C# library you can use in Console apps, Windows Forms, PowerShell, ASP.NET (in any .NET language). If you have a multithreaded app you will have to configure the library to run syncronously, but overall a good client that will most likely get you what you need.
You could use the ones on CodePlex or http://www.enterprisedt.com/general/press/20060818.html
I've just posted an article that presents both an FTP client class and an FTP user control.
They are simple and aren't very fast, but are very easy to use and all source code is included. Just drop the user control onto a form to allow users to navigate FTP directories from your application.
After lots of investigation in the same issue I found this one to be extremely convenient:
https://github.com/flagbug/FlagFtp
For example (try doing this with the standard .net "library" - it will be a real pain) ->
Recursively retreving all files on the FTP server:
public IEnumerable<FtpFileInfo> GetFiles(string server, string user, string password)
{
var credentials = new NetworkCredential(user, password);
var baseUri = new Uri("ftp://" + server + "/");
var files = new List<FtpFileInfo>();
AddFilesFromSubdirectory(files, baseUri, credentials);
return files;
}
private void AddFilesFromSubdirectory(List<FtpFileInfo> files, Uri uri, NetworkCredential credentials)
{
var client = new FtpClient(credentials);
var lookedUpFiles = client.GetFiles(uri);
files.AddRange(lookedUpFiles);
foreach (var subDirectory in client.GetDirectories(uri))
{
AddFilesFromSubdirectory(files, subDirectory.Uri, credentials);
}
}

Categories