MciStringSender is a simple .NET 5 console application that can be used to send Multimedia command strings to Media Control Interface (MCI).
- MciStringSender.cs - a simple wrapper around mciSendString and mciGetErrorString Windows API functions.
var mciRequest = Console.ReadLine();
if (mciRequest != null)
{
var mciStringSender = new MciStringSender();
if (mciStringSender.TrySendString(mciRequest, out var mciResponse))
{
if (!String.IsNullOrEmpty(mciResponse))
{
Console.WriteLine(mciResponse);
}
}
else
{
Console.WriteLine($"Error {mciStringSender.LastErrorCode} '{mciStringSender.LastErrorString}'");
}
}
- MciPlayer.cs - a helper class that uses
MciStringSender
class to play multimedia files.