Split PDF in C# for free with .NET Core and iText.Kernel.Pdf

0 Comments

using iText.Kernel.Pdf; namespace RvvFacturatie.Services { public class PdfService { public void Split(string filePath, string outputFolderPath) { // Make sure the output folder exists and is empty. if (Directory.Exists(filePath)) { Directory.Delete(filePath, true); } Directory.CreateDirectory(outputFolderPath); using (var

Map network drive in C#

0 Comments

// Create network drive mapping System.Diagnostics.Process.Start(“net.exe”, @”use K: “”\\my.server.com\Websites\Mail“” /user:MyDomain\admin MySuperSecretPassword”).WaitForExit(); // Remove network drive mapping System.Diagnostics.Process.Start(“net.exe”, @”use K: /delete”).WaitForExit();

How to send a free SMS from C#

0 Comments

I used the following code to send a free SMS from C#, by using the messagebird REST service.   using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; namespace DocumentenService.Client { public class Program { public

UseWebApi not found / missing in Web API 2.2

0 Comments

If the IAppBuilder interface does not contain a “UseWebApi” function, this might be caused by a missing NuGetPackage “Microsoft.AspNet.WebApi.Owin”.   After installing this NuGetPackage the function was available.     See: http://www.jeffwids.com/post/where-does-iappbuilderusewebapi-come-from

How to rename an user in Active Directory with C#

5 Comments

  If you want to rename an user in Active Directory by using C#, you can use the following code: using System; using System.Collections.Generic; using System.DirectoryServices; using System.DirectoryServices.AccountManagement; using System.Linq; using System.Text; using System.Threading.Tasks; namespace