Tag: win universal app

无法识别StartupTask类

我正在尝试让我的Centennial应用程序在登录时自动启动。 根据这篇文章可以做到。 但是以编程方式禁用它我需要使用Windows.ApplicationModel.StartupTask类,Visual Studio拒绝识别它。 那个class级怎么用?

如何在Universal Windows Platform中检查Internet连接类型

我想在Windows Universal Application中检查互联网连接类型。 未连接 通过WLAN(WiFi)连接 通过WWAN连接(蜂窝数据) 连接到计量网络 为了提供下载大尺寸内容的选项。 并且还可以感知重要的网络可用性变化。 目前,我只能使用NetworkInterface类的GetIsNetworkAvailable方法检查互联网是否连接。 NetworkInterface.GetIsNetworkAvailable();

在C#中打开文件拒绝访问

我试图读取文本文件的内容,但我得到’System.UnauthorizedAccessException’类型的’访问路径被拒绝’例外。 我尝试过以下方法: 以管理员模式运行 检查文件是否为只读 检查文件是否隐藏 检查文件是否完全控制所有用户 我的代码: private async void MyButton_Click(object sender, RoutedEventArgs e) { string path = @”fullpath\TextFile.txt”; await Task.Run(() => { string text = File.ReadAllText(path); }); }

如何在UWP中使用3级语义缩放?

我想使用语义缩放(或其效果)来选择我的UWP应用程序中的位置。 我想首先选择县,然后选择第二个城市,然后选择第三个位置。 有人对此有真正的想法吗? 我搜索了多个缩放进行语义缩放,但这显然是不可能的。 我使用了两个语义缩放视差,但这也存在问题。 有人可以帮忙吗?

如何在listviewitem UWP中折叠子控件

通用Windows平台,C# 如何从后面的代码中折叠/展开项MainListView listitem的子列表视图? 我没有发现任何有效的东西。 我想在SelectionChanged事件上执行此操作。 XAML **** 代码隐藏 private void listview_SelectionChanged(object sender, SelectionChangedEventArgs e) { //GET THE ITEM var selectItem = DestListView.Items[DestListView.SelectedIndex]; //GET THE CHILD SOMEHOW //ListView childListView = (ListView)…not sure what to do here //if (childListView != null) //{ // if (childListView.Visibility == Visibility.Collapsed) // { // //childListView.Visibility = Visibility.Collapsed; // } // else […]

Windows Universal App – 从Azure容器下载所有Blob

我有一个通用Windows应用程序。 我试图在应用程序启动时从azure容器中下载所有blob。 这是我的代码: public MainPage() { this.InitializeComponent(); downloadblobs(); } public async void downloadblobs() { CloudStorageAccount storageaccount = new CloudStorageAccount(new StorageCredentials(“accountname”, “accountkey”), true); CloudBlobClient blobClient = storageaccount.CreateCloudBlobClient(); CloudBlobContainer container = blobClient.GetContainerReference(“ContainerName”); //——————— int fileName = 1; var client = storageaccount.CreateCloudBlobClient(); BlobContinuationToken continuationToken = null; string prefix = null; bool useFlatBlobListing = true; BlobListingDetails blobListingDetails = BlobListingDetails.All; […]

如何制作可与默认WCF服务应用程序一起使用的UWP

如果您创建一个新项目WCF Service Application C#,它将创建一个Web服务并启动它。 但是没有关于如何从客户端实际与之通信的信息,或者如何编写它。 UWP客户端与该服务通信的外观如何?

UWP RSA AsymmetricKeyAlgorithmProvider导入公钥

当我尝试在UWP中使用Windows.Security.Cryptography.Core时,我总是从AsymmetricKeyAlgorithmProvider导入公钥时出错。 我尝试了所有组合而没有成功。 我总是检查输入字符串是否为UTF8模式。 try { var bytes = Encoding.UTF8.GetBytes(publicKeyString); publicKeyString = Encoding.UTF8.GetString(bytes); Debug.WriteLine(publicKeyString); IBuffer keyBuffer = CryptographicBuffer.DecodeFromBase64String(publicKeyString); byte[] bytes = Convert.FromBase64String(publicKeyString); string hex = “”; Debug.WriteLine(hex); AsymmetricKeyAlgorithmProvider provider = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithmNames.RsaPkcs1); CryptographicKey publicKey = provider.ImportPublicKey(CryptographicBuffer.DecodeFromHexString(hex), CryptographicPublicKeyBlobType.BCryptPublicKey); IBuffer dataBuffer = CryptographicBuffer.CreateFromByteArray(Encoding.UTF8.GetBytes(plainText)); var encryptedData = CryptographicEngine.Encrypt(publicKey, dataBuffer, null); return CryptographicBuffer.EncodeToBase64String(encryptedData); } catch (Exception e) { throw; return “Error […]

页面导航WP8.1

我为WP8制作了一个应用程序,我使用了NavigationService.Navigate(new Uri(…))等页面导航,效果很好。 但现在我正在尝试开发一个WP8.1应用程序,但无法弄清楚它是怎么回事。 我收到以下错误The name ‘NavigationService’ does not exist in the current context 。 我有两页,我想在它们之间导航。 我能怎么做? 改变了什么?

如何在Windows Core IoT应用程序中显示当前时间的时钟?

我正在尝试创建一个在Raspberry Pi 2上运行无头的Windows 10 IoT应用程序。一切都设置正确,我可以使用Raspberry Pi作为远程机器进行调试,从Visual Studio调试我。 现在我想在应用页面上添加一个时钟,但我无法弄清楚如何更新显示的时间。 在普通的旧C#中,我会使用BackgroudWorker或类似的东西来保持显示的时间是最新的,但是UWP中没有这种类型。 我一直在MSDN上查看“创建并注册后台任务” ,但这似乎是复杂的,只是为了能够使显示时间保持最新。 所以我的问题是:我怎样才能 – 以最简单的方式 – 创建一个时钟显示,每次时间点都会更新?