fork download
  1. [DllImport("winmm.dll")]
  2.  
  3. private static extern long mciSendString(string strCommand,
  4. StringBuilder strReturn, int iReturnLength, IntPtr oCallback);
  5.  
  6. static void Main(string[] args)
  7. {
  8. string strFileName = @"C:\1.mp3.";
  9. string PlayCommand = @"open " + strFileName + "alias MediaFile";
  10.  
  11. mciSendString(PlayCommand, null, 0, IntPtr.Zero);
  12.  
  13.  
  14.  
  15. PlayCommand = "play MediaFile";
  16.  
  17. mciSendString(PlayCommand, null, 0, IntPtr.Zero);
  18. Console.ReadKey();
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:8:30: error: stray ‘@’ in program
         string strFileName = @"C:\1.mp3.";
                              ^
prog.cpp:9:30: error: stray ‘@’ in program
         string PlayCommand = @"open " + strFileName + "alias MediaFile";
                              ^
prog.cpp:1:1: error: expected unqualified-id before ‘[’ token
 [DllImport("winmm.dll")]
 ^
prog.cpp:6:22: error: variable or field ‘Main’ declared void
     static void Main(string[] args)
                      ^~~~~~
prog.cpp:6:22: error: ‘string’ was not declared in this scope
prog.cpp:6:29: error: expected primary-expression before ‘]’ token
     static void Main(string[] args)
                             ^
stdout
Standard output is empty