目前.Ne Framework中的确没有这样的类和函数,简单的你可以P/Ivoke调用原来的API来完成你的功能.
比如调用PlaySound
=================
[DllImport("winmm.dll", EntryPoint="PlaySound")]
private static extern bool PlaySound(string pszSound, IntPtr hmod, uint fdwSound); SND_SYNC = 0x0000,
SND_ASYNC = 0x0001,
SND_NODEFAULT = 0x0002,
SND_MEMORY = 0x0004,
SND_LOOP = 0x0008,
SND_NOSTOP = 0x0010,
SND_NOWAIT = 0x00002000,
SND_ALIAS = 0x00010000,
SND_ALIAS_ID = 0x00110000,
SND_FILENAME = 0x00020000,
SND_RESOURCE = 0x00040004 这样使用
=====================================
PlaySound( strFileName, IntPtr.Zero, FlagsForPlaying);你也可以把上面的flags做成enum
比如调用PlaySound
=================
[DllImport("winmm.dll", EntryPoint="PlaySound")]
private static extern bool PlaySound(string pszSound, IntPtr hmod, uint fdwSound); SND_SYNC = 0x0000,
SND_ASYNC = 0x0001,
SND_NODEFAULT = 0x0002,
SND_MEMORY = 0x0004,
SND_LOOP = 0x0008,
SND_NOSTOP = 0x0010,
SND_NOWAIT = 0x00002000,
SND_ALIAS = 0x00010000,
SND_ALIAS_ID = 0x00110000,
SND_FILENAME = 0x00020000,
SND_RESOURCE = 0x00040004 这样使用
=====================================
PlaySound( strFileName, IntPtr.Zero, FlagsForPlaying);你也可以把上面的flags做成enum
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货