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;
}

 

0 0 投票数
文章评分
订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x