环顾四周,我找不到任何解决方案。
谢谢你们!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Media.Devices;
using Windows.Media.Capture;
namespace LEDBlinkerConsole
{
class Torch
{
public async static void BlinkLED()
{
MediaCapture mc = new MediaCapture();
await mc.InitializeAsync();
Console.WriteLine("Please type \"flash\" to flash the LED\n");
string consInput = Console.ReadLine();
if (consInput.ToUpper() == "FLASH")
{
if (mc.VideoDeviceController.TorchControl.Supported == true)
{
mc.VideoDeviceController.TorchControl.Enabled = true;
mc.VideoDeviceController.TorchControl.PowerPercent = 100;
}
}
}
}
}
我想到了。我引用了“ System.Runtime”,而我不得不引用了“ System.Runtime.Windowsruntime”。为了使其起作用,我必须删除对“ System.Runtime”的引用。有关来自非都市应用程序的异步调用的更多信息,请参见:http : //www.wintellect.com/blogs/jeffreyr/using-the-windows-runtime-from-a-non-metro-application
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句