Skip to content

Instantly share code, notes, and snippets.

@earlgreyxxx
Last active November 1, 2020 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earlgreyxxx/05f068393be34a95ec368a2669d68007 to your computer and use it in GitHub Desktop.
Save earlgreyxxx/05f068393be34a95ec368a2669d68007 to your computer and use it in GitHub Desktop.
/*******************************************
* JUST ONLY PLAY SOUND FILE(WAV)
build:
>> csc -target:winexe playsound.cs
usage:
>> playsound logon.wav
namespaceは適当に変えてね。
*******************************************/
using System.IO;
using System.Media;
namespace jp.ptsv.windows
{
class PlaySound
{
static void Main(string [] args)
{
if(args.Length > 0 && File.Exists(args[0]))
(new SoundPlayer(args[0])).PlaySync();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment