using System.Runtime.InteropServices; using System.Text; [DllImport("winmm.dll")] private static extern long mciSendString( string command, StringBuilder returnValue, int returnLength, IntPtr winHandle); private void OpenMediaFile(string file) { string Command = "Open \"" + file + "\" type mpegvideo alias hello"; mciSendString(Command, null, 0, IntPtr.Zero); mciSendString("Play hello", null, 0, IntPtr.Zero); } private void Button_Click_1(object sender, RoutedEventArgs e) { OpenMediaFile(input1.Text.ToString()); //input1 is a textbox }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)