[DllImport("winmm.dll")] private static extern long mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, int hwndCallback); public bool open(string file) { if (!File.Exists(file)) return false; string command = "open " + file + " type MPEGVideo alias MyMp3"; mciSendString(command, null, 0, 0); return true; } public void play() { string command = "play MyMp3"; mciSendString(command, null, 0, 0); } public void stop() { string command = "stop MyMp3"; mciSendString(command, null, 0, 0); command = "close MyMp3"; mciSendString(command, null, 0, 0); }
[STAThread]
[STAThread] static void Main(string[] args) { ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)