[問題] ArgumentException
小弟想要在win7底下作音量控制
我使用了這裡的code
http://www.java2s.com/Code/CSharp/Windows/SoundUtils.htm
我又另外在public class EndpointVolume加上一個function
public string GetCurrentDeviceId()
{
string strId = null;
try
{
int retVal = imd.GetId(ref strId);
if (retVal != 0)
throw new Exception(string.Format("IMMDevice.GetId() failed!);
return strId;
}
catch (Exception ex)
{
throw ex;
}
}
想要去抓取現在device的 ID值
可是都會出現
System.ArgumentException: Value does not fall within the expected range.
請問有人知道這是為什麼會這樣嗎? 又該如何解決
小弟我被這exception卡了好幾天
麻煩各位指教了~謝謝
※ 編輯: ljhgc 來自: 220.130.148.139 (10/28 19:30)
推
10/28 20:21, , 1F
10/28 20:21, 1F
→
10/28 20:37, , 2F
10/28 20:37, 2F
→
10/28 21:30, , 3F
10/28 21:30, 3F
→
10/28 21:31, , 4F
10/28 21:31, 4F
推
10/29 01:02, , 5F
10/29 01:02, 5F
→
10/29 11:03, , 6F
10/29 11:03, 6F
→
10/29 11:04, , 7F
10/29 11:04, 7F
推
10/29 12:11, , 8F
10/29 12:11, 8F
→
10/29 13:33, , 9F
10/29 13:33, 9F
→
10/29 13:33, , 10F
10/29 13:33, 10F
→
10/29 13:34, , 11F
10/29 13:34, 11F