i have code download videos internet. code can run in runtime app can't run in windows phone silverlight 8.1 app.
private async void dinhmenh_click(object sender, routedeventargs e) { storagefile destinationfile; try { destinationfile = await knownfolders.videoslibrary.createfileasync("baihay" + ".mp4", creationcollisionoption.replaceexisting); messagebox.show("1"); } catch { return; } messagebox.show("2"+ destinationfile.tostring()); // messagebox try { downloadlink = new uri("url", urikind.relativeorabsolute); var downloader = new backgrounddownloader(); _download = downloader.createdownload(downloadlink, destinationfile); await _download.startasync(); ; } catch(exception ex) { messagebox.show(ex.tostring()); } await handledownloadasync(); messagebox.show("finish!"); }
Comments
Post a Comment