您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 人事档案/员工关系 > Windows8应用开发-8 .NET开发人员技术精粹
DllImport“avicap32.dll”“capCreateCaptureWindow”staticexternintstringintintintintintintintDllImport“avicap32.dll”staticexternboolintMarshalAsUnmanagedTyperefstringintMarshalAsUnmanagedTyperefstringint//moreandmoreofthesameusingWindows.Media.Capture;varnewCameraCaptureUInewSizevarawaitCameraCaptureUIModeifvarnewBitmapImageawaitFileAccessMode演示FileOpenPickerpicker=newFileOpenPicker();picker.FileTypeFilter.Add(*);StorageFilefile=awaitpicker.PickSingleFileAsync();Windows.Storage.Streams.IInputStreaminputStream=awaitfile.OpenForReadAsync();System.IO.Streamstream=inputStream.AsStream();System.IO.StreamReaderreader=newStreamReader(stream);stringcontents=reader.ReadToEnd();演示varvarpublicasyncTaskXElementGetXmlAsync(stringurl){varclient=newHttpClient();varresponse=awaitclient.GetAsync(url);vartext=response.Content.ReadAsString();returnXElement.Parse(text);}publicTaskXElementGetXmlAsync(stringurl){vartcs=newTaskCompletionSourceXElement();varclient=newHttpClient();client.GetAsync(url).ContinueWith(task={varresponse=task.Result;vartext=response.Content.ReadAsString();tcs.SetResult(XElement.Parse(text));});returntcs.Task;}演示演示
本文标题:Windows8应用开发-8 .NET开发人员技术精粹
链接地址:https://www.777doc.com/doc-4993065 .html