All Posts (299) 299


Read System Certificates in UWP

In Windows, we can view and manage the certificates using certmgr.msc, which is a system management console included in Windows itself.  However, what if we want to view the certificates information in an UWP app? Here is the answer. First thing first, the method I use does not apply to UWP only. In fact it is from a WPF app I wrote. As Microsoft released .NET Standard 2.0, which allows me to...

UWP

Deploy Linux VPN Server on Microsoft Azure

For some unspeakable reasons, this article can not expose too many details about every steps to setup and configure the VPN server, but the key steps and scripts will all be listed.  So you will need basic Linux command knowledge and some Azure experience in order to complete the operation.  The reason for choosing Linux over Windows is because the cost is way less then Windows machines, so that...

VPN Azure Linux

Send Feedback in UWP Apps by Windows 10 Feedback Hub

After our app has been put on Microsoft Store, there are a lot of ways to get users to send feedback, such as email, store reviews, or even write our own API collect feedback. But in fact, Windows 10 Feedback Hub can also be used to send feedbacks for our own Apps. Those who are familiar with Windows Insider know that when Windows 10 is installed, the system has a Feedback Hub, which is usually u...

UWP

Customize Acrylic Brush in UWP Applications

Windows 10 Fall Creators Update (Build 16299) added acrylic brush, this is a UI brush that similar to Windows 7 Aero effect. A lot in box Windows Apps, such as Calculator are updated with the acrylic brush. However, the built in brushes will not always meet our own requirments. Especially when Windows automatically disable render of acrylic, such as low power mode, or with an inactive window, i...

UWP

Apply Keyboard Short Cuts in UWP

A greate Windows App requires not only mouse and touch screen friendly, but also need to think about keyboards. Especially for some common short cuts, like Undo (CTRL + Z). So that the App can provide better user experience.  So how can we define short cut keys in UWP? Take my App Tracing as example, I need to implement short cuts for Undo (CTRL + Z). First, we need to consider which Control is b...

UWP

Show Confirm Dialog When User Close UWP App

When our UWP Application deal with user data in it, e.g. like drawings or documents, we usually want to make sure user won't close the App by accident and lose their work. Just like what you see in a Office application, it will ask you if you want to save your document before close the App. For a long time, UWP could not do that in a normal way. Because it is not a general public API and it is st...

UWP

Windows 10 秋季更新上用编程方式重启UWP应用

有时候,我们的UWP应用会要求用户重启,以应用一些设置。通常情况下,用户只能手工关闭App并再次打开完成重启的步骤。其实,在Windows 10秋季更新里,开发者已经可以通过编程方式,让用户一键完成自动重启App的工作。 比如我的“Character Map UWP”这个应用,在用户更改设置后,需要重启生效。那么第一步,就是在设置页面加一个重启按钮“Restart Now”: 然后,我们需要通过秋季更新中的全新牛逼API RequestRestartAsync(String) 来完成重启。 这个API的签名如下: public static IAsyncOperation RequestRestartAsync(String launchArguments) 如果只是为了完成重启,不需要参数,那么lauchArguments是可以留空的。 所以,在我的这个例子里,最简单...

UWP

Install Linux Subsystem on Windows 10 Fall Creators Update

In the recent Windows 10 v1709 Fall Creators Update, the Windows subsystem for Linux has been improved a lot. Let's see how easy it is now to install Linux on Windows. 1. Enable Windows Subsystem for Linux Because the classic control panel has been hidden, now the quickest way to access Programs and Features is to run appwiz.cpl And then check "Windows Subsystem for Linux" under "Turn Windows...

Windows Linux

Use ICMP Ping in .NET Core 2.0

In classic .NET Framework applications, we have used System.Net.NetworkInformation.Ping class to Ping a host address. This API is not included by default in .NET Core, even in version 2.0. Here is how to do it in a .NET Core way. First, we need to reference a package System.Net.Ping Install-Package System.Net.Ping This will give us the same API set as .NET Framework. Then, in your .NET Core...

.NET Core Ping ICMP

Use NLog in ASP.NET Core 2.0

There's official update for NLog targeting ASP.NET Core 2.x, for the latest methods please refer to https://github.com/NLog/NLog.Web/wiki/Getting-started-with-ASP.NET-Core-2 Recently I am porting a classic ASP.NET MVC 5 project to .NET Core 2.0, in order to run it on Linux. One of the parts that has differences between .NET Fx and .NET Core is logging. I choose NLog as my logging providor, let's...

.NET Core NLog