UWP 判断程序是否为第一次运行

 0x00.添加引用

using System;
using System.Collections.Generic;
using System.Linq;
using Windows.Storage;


0x01.通过判断本地设置文件中是否存在对应项来判断是否为第一次运行

public static bool IsFirstlyRun()
{
    ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
    if (localSettings.Values["BackgroundSource"] == null)
        return true;
    else
        return false;
}

 

UWP 判断程序是否为第一次运行
https://blog.async.website/index.php/archives/326/
本文作者 snowysong@live.com
发布时间 2017-04-02
许可协议 CC BY-NC-SA 4.0
发表新评论