⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 playsound.cs

📁 C#制作的经典游戏:数字拼图 提供源代码参考
💻 CS
字号:
using System;
using System.Runtime.InteropServices;

namespace NumPuzzle
{
	/// <summary>
	/// PlaySound 的摘要说明。
	/// </summary>
	public class PlaySound
	{

		private const int SND_SYNC = 0x0;
		private const int SND_ASYNC = 0x1;
	    private const int SND_NODEFAULT = 0x2;
		private const int SND_LOOP = 0x8;
		private const int SND_NOSTOP = 0x10;

		public static void Play(string file)
		{
			int flags = SND_ASYNC | SND_NODEFAULT;
			sndPlaySound(file,flags);
		}

		[DllImport("winmm.dll")]
		private extern static int sndPlaySound(string file,int uFlags);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -