Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free

.NET posts

  • By Marcos Placona
    Envoyer un SMS avec C# en 30 secondes Envoyer un SMS avec C# en 30 secondes

    Vous construisez une application .NET et vous avez besoin d’envoyer des messages SMS. Et si je vous disais que vous pouvez le faire en 30 secondes avec l’API Twilio ? Voici une vidéo qui vous montre à quel point il est rapide de pouvoir envoyer un SMS avec C# et l’API Twilio.

    Vidéo : Comment envoyer un SMS avec C# en 30 secondes

    Mais puisque vous ne pouvez pas copier/coller à partir d’une vidéo, voici tout le code dont vous aurez besoin.

    Installez la librairie helper Twilio pour .NET à votre projet en utilisant le gestionnaire de package de votre console (Package Manager).

    PM> Install-Package Twilio

    Importez le namespace Twilio dans votre classe et initialisez le Twilio Client REST en lui passant votre Account SID et Auth Token - qui sont disponibles sur le portail Twilio.

    using System;
    using Twilio;
    using Twilio.Rest.Api.V2010.Account;
    using Twilio.Types;
    namespace twilio_sms
    { …
    Read More
  • By David Pine
    Build a Video Chat App with ASP.NET Core 5.0, Angular 11, and Twilio Programmable Video Build a Video Chat App with ASP.NET Core 5.0, Angular 11, and Twilio Programmable Video

    Realtime user interaction is a great way to enhance the communication and collaboration capabilities of a web application. Video chat is an obvious choice for sales, customer support, and education sites, but is it practical to implement? If you’re developing with Angular on the frontend and ASP.NET Core for your server, Twilio Programmable Video enables you to efficiently add robust video chat to your application.

    This post will show you how to create a running video chat application using the Twilio JavaScript SDK in your Angular single page application (SPA) and the Twilio SDK for C# and .NET in your ASP.NET Core server code. You’ll build the interactions required to create and join video chat rooms, and publish and subscribe to participant audio and video tracks.

    To learn how to build the same app with previous language and framework versions, see these posts:

    Read More
  • By Niels Swimberghe
    Making Phone Calls from Blazor WebAssembly with Twilio Voice blazor-twilio-voice (1).png

    Mobile phones are ubiquitous and convenient but there are times when it’s more practical to be able to receive and place phone calls from a computer. If you’ve called customer service about the tickets you ordered, or anything else, it’s likely the rep you spoke to took your call with a mouse click.

    Using Twilio Voice you can add the ability to make and receive phone calls from your own ASP.NET web applications. Twilio’s helper library for JavaScript makes it easy to integrate client functionality into web front ends built with Blazor WebAssembly, and the Twilio NuGet packages provide you with convenient interfaces to Twilio’s APIs for server-side tasks.

    Blazor WebAssembly lets you build your application front end in C# and Razor, so you can focus the client-side JavaScript on functionality that requires JavaScript for implementation.

    JavaScript interoperability (JS interop) is a feature of Blazor that makes it easy to …

    Read More
  • By Dustin Ewers
    Get in Touch with Your Inner Hipster Using C# 9.0 Records csharp-9-records.png

    If you’ve been a professional developer for more than a year or two, you’ve probably heard some hipster developer rave about functional programming. Much like how music sounds better on vinyl, programming is just better in functional languages. Your IQ jumps ten points if you can write a Fibonacci generator in Lisp, and it jumps twenty points if you can accurately describe what a monad is.

    Jokes aside, like craft beer and artisan bacon, the hipsters have a point. As someone who has kids and hobbies, I can’t help you with monads, but learning about less esoteric functional programming concepts will help you write cleaner code with fewer bugs.

    Functional programming concepts have been finding their way in our general-purpose programming languages for years, and C# 9 is no exception. In the latest version of C#, Microsoft has introduced some new functional goodies, mostly around immutable programming. In this post, …

    Read More
  • By Dustin Ewers
    C# 8 – Excelling at Indexes csharp-8-indexes.png

    “There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors.” — Riff on a joke by Phil Karlton

    After this post, one of these problems will become a little easier for you to solve: you’re going to learn about indices and ranges. While nearly everyone programming in C# uses standard indexes on a regular basis, there are some new ways of accessing arrays and lists that can make your development life a little bit easier. In a few minutes you’ll be up to speed on this C# 8.0 feature and more prepared to take on the C# 9.0 release.


    One of the first things you learn as a beginning programmer in any language is how to access an array. Most languages use a 0-based index. Some languages use 1-based array indexes (and are wrong), but the basic syntax is similar. Here are a …

    Read More
  • By Jeff Rosenthal
    Sending and Receiving SMS Messages In Windows Presentation Foundation Apps with Twilio Messaging wpf-twilio-sms.png

    The vast majority of SMS messages are sent and received from person to person on mobile phones. But there are also times it’s helpful to be able to send and receive SMS messages from a custom application running on a desktop or laptop computer.

    If you’ve built an application with Windows Presentation Foundation (WPF) you can integrate bidirectional SMS capabilities into your custom user interface with Twilio Messaging. Twilio’s SMS service enables you to send and receive SMS messages programmatically through a Twilio phone number.

    In this tutorial you’ll learn how to set up a Twilio phone number to send and receive SMS messages and how to interact with the Twilio APIs to use the Twilio phone number to send and receive SMS messages from a WPF application. You’ll see how a WPF user interface can be automatically updated when new messages arrive and you’ll learn how to group messages …

    Read More
  • By Niels Swimberghe
    Building Real-Time Applications with Blazor Server and Firestore blazor-server-firestore.png

    Blazor is a framework for building interactive client-side user interfaces for web applications using .NET. Using Blazor, .NET developers can build stylish and performant web interfaces using C# and ASP.NET Core instead of JavaScript. [Pause for applause.]

    Blazor Server provides support for hosting Razor components on a server in an ASP.NET Core app. At runtime, the Blazor Server app sends UI events from the browser to the server and applies UI updates sent from the server to the rendered component.

    Blazor Server is built on SignalR, which is built on websockets. Among things, websockets enable Blazor Server to push changes from the server to the browser at any time. You can build real time UIs when you combine this with a real-time database such as Google Firestore.

    Firestore is Google Firebase's real-time database offering on the Google Cloud Platform (GCP). Google provides .NET libraries for interacting with …

    Read More
  • By Jeff Rosenthal
    Introducing Windows Presentation Foundation (WPF) Animations wpf-animations.png

    When it comes to web pages, HTML is the tool to present the elements and CSS to provide the styling. Sure, there are exceptions and embellishments but, in short, that is how it boils down. If you want to implement some sort of animation or have something move, and it’s more complex than the simple animations supported by CSS, you generally have to fall back on JavaScript. In contrast, these aspects of presentation, styling, and animation are all an integral part of the Windows Presentation Foundation XAML.

    XAML stands for Extensible Application Markup Language, and it is a declarative language that describes WPF’s elements, relationships, and behaviors. XAML elements map directly to Common Language Runtime (CLR) object instances and XAML attributes correspond to the properties and events of CLR objects.

    In this tutorial, you will explore the various ways to animate visual elements in …

    Read More
  • By Jeff Rosenthal
    Understanding Windows Presentation Foundation (WPF) Data Binding with the DataContext Class In .NET Core wpf-datacontext.png

    The Windows Presentation Foundation (WPF) framework allows you to develop desktop applications with amazing graphic capabilities, but it does not stop there. An application needs to display data of some sort and connecting UIElements to underlying data structures needs to be flexible. That is where DataContext comes into play.

    DataContext works hand-in-hand with data binding to provide hierarchical data presentation. It is what connects the front end to the code-behind and enables changes made to data in the user interface to update the data source, and conversely, while maintaining the order of your data structure. You’ll see  examples of this in the case study project for this post.

    This tutorial will guide you through building a WPF application where you can explore DataContext at work. You will create a data dashboard that visualizes data from different simulated sources.


    You’ll need the following tools and resources to build and run …

    Read More
  • By Jeff Rosenthal
    Understanding Windows Presentation Foundation Routed Events In .NET Core wpf-routed-events.png

    Windows Presentation Foundation (WPF) is a very powerful framework for building desktop applications. Unlike Windows Forms, WPF provides the capabilities of nested UIElements, animation, layered presentation, and more. The focus of this tutorial is to demonstrate the aspects of Routed Events.

    Routed Events are a construct specific to WPF that supports event routing. It allows for the processing of events in a very flexible fashion to meet a particular capability.

    User interface elements (UIElements) have the ability to nest elements. A panel can contain a button which can contain a panel. Within that panel could be an image and some text. The user then clicks the mouse button. What element is expected to handle the event? Is it the text or the image? It could even be the panel that holds them or the button itself.

    A common practice is to add a mouse click handler for a …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.