背水一戰 Windows 10 (17) - 動畫: ThemeTransition(過渡效果)

来源:http://www.cnblogs.com/webabcd/archive/2016/06/16/5590577.html
-Advertisement-
Play Games

背水一戰 Windows 10 之 動畫: ThemeTransition 的概述, EntranceThemeTransition - 頁面間跳轉時的過渡效果, ContentThemeTransition - 內容改變時的過渡效果, RepositionThemeTransition - 位置改... ...


[源碼下載]


背水一戰 Windows 10 (17) - 動畫: ThemeTransition(過渡效果)



作者:webabcd


介紹
背水一戰 Windows 10 之 動畫

  • ThemeTransition 的概述
  • EntranceThemeTransition - 頁面間跳轉時的過渡效果
  • ContentThemeTransition - 內容改變時的過渡效果
  • RepositionThemeTransition - 位置改變時的過渡效果
  • PopupThemeTransition - 彈出時的過渡效果
  • AddDeleteThemeTransition - 添加項或刪除項時的過渡效果
  • ReorderThemeTransition - 對集合中的元素重新排序時的過渡效果
  • PaneThemeTransition - 基於邊緣的較大 UI 滑入和滑出時的過渡效果
  • EdgeUIThemeTransition - 基於邊緣的較小 UI 滑入和滑出時的過渡



示例
1、過渡效果的概述
Animation/ThemeTransition/Summary.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Summary"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <TextBlock Text="請參見本 xaml 中的註釋" />

            <!--
                UIElement.Transitions - 指定 UIElement 的過渡動畫
            
                <Rectangle>
                    <Rectangle.Transitions>
                        <TransitionCollection>
                            <EntranceThemeTransition/>
                        </TransitionCollection>
                    </Rectangle.Transitions>
                </Rectangle>
            -->


            <!--
                Panel.ChildrenTransitions - 指定 Panel 的子元素們的過渡動畫
            
                <WrapGrid>
                    <WrapGrid.ChildrenTransitions>
                        <TransitionCollection>
                            <EntranceThemeTransition/>
                        </TransitionCollection>
                    </WrapGrid.ChildrenTransitions>
                </WrapGrid>
            -->


            <!--
                ItemsControl.ItemContainerTransitions - 指定 ItemsControl 的項容器的過渡動畫
            
                <ItemsControl>
                    <ItemsControl.ItemContainerTransitions>
                        <TransitionCollection>
                            <EntranceThemeTransition/>
                        </TransitionCollection>
                    </ItemsControl.ItemContainerTransitions>
                </ItemsControl>
            -->


            <!--
                ContentControl.ContentTransitions - 指定 ContentControl 的過渡動畫
            
                <ContentControl>
                    <ContentControl.ContentTransitions>
                        <TransitionCollection>
                            <EntranceThemeTransition/>
                        </TransitionCollection>
                    </ContentControl.ContentTransitions>
                </ContentControl>
            -->

        </StackPanel>
    </Grid>
</Page>


2、演示 EntranceThemeTransition
Animation/ThemeTransition/Entrance.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Entrance"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <!--
                EntranceThemeTransition - 頁面間跳轉時的過渡效果
                    FromHorizontalOffset - 初始位置的水平偏移量
                    FromVerticalOffset - 初始位置的垂直偏移量
                    IsStaggeringEnabled - 當包含多個子元素時,是否需要錯開呈現它們
            -->
            <Frame Name="frame" Width="400" Height="100" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Frame.ContentTransitions>
                    <TransitionCollection>
                        <EntranceThemeTransition IsStaggeringEnabled="False" />
                    </TransitionCollection>
                </Frame.ContentTransitions>
            </Frame>

            <Button Name="btnGotoFrame1" Content="導航至 Frame1" Click="btnGotoFrame1_Click" Margin="0 10 0 0" />
            <Button Name="btnGotoFrame2" Content="導航至 Frame2" Click="btnGotoFrame2_Click" Margin="0 10 0 0" />

            <ItemsControl x:Name="itemsControl" Margin="0 10 0 0">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid>
                            <WrapGrid.ChildrenTransitions>
                                <TransitionCollection>
                                    <EntranceThemeTransition IsStaggeringEnabled="True" />
                                </TransitionCollection>
                            </WrapGrid.ChildrenTransitions>
                        </WrapGrid>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.Items>
                    <Rectangle Width="100" Height="100" Fill="Red" />
                    <Rectangle Width="100" Height="100" Fill="Green" />
                    <Rectangle Width="100" Height="100" Fill="Blue" />
                </ItemsControl.Items>
                <ItemsControl.Template>
                    <ControlTemplate>
                        <Border BorderBrush="Orange" BorderThickness="1">
                            <ItemsPresenter Margin="10" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Border>
                    </ControlTemplate>
                </ItemsControl.Template>
            </ItemsControl>

        </StackPanel>
    </Grid>
</Page>

Animation/ThemeTransition/Entrance.xaml.cs

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Windows10.Animation.ThemeTransition
{
    public sealed partial class Entrance : Page
    {
        public Entrance()
        {
            this.InitializeComponent();
        }

        private void btnGotoFrame1_Click(object sender, RoutedEventArgs e)
        {
            frame.Navigate(typeof(Frame1));
        }

        private void btnGotoFrame2_Click(object sender, RoutedEventArgs e)
        {
            frame.Navigate(typeof(Frame2));
        }
    }
}

Animation/ThemeTransition/Frame1.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Frame1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">
            <TextBlock Name="lblMsg" Text="我是 Frame1" />
        </StackPanel>
    </Grid>
</Page>

Animation/ThemeTransition/Frame2.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Frame2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">
            <TextBlock Name="lblMsg" Text="我是 Frame2" />
        </StackPanel>
    </Grid>
</Page>


3、演示 ContentThemeTransition
Animation/ThemeTransition/Content.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Content"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <!--
                ContentThemeTransition - 內容改變時的過渡效果
                    FromHorizontalOffset - 初始位置的水平偏移量
                    FromVerticalOffset - 初始位置的垂直偏移量
            -->
            <ContentControl Name="contentControl" PointerPressed="contentControl_PointerPressed">
                <ContentControl.ContentTransitions>
                    <TransitionCollection>
                        <ContentThemeTransition />
                    </TransitionCollection>
                </ContentControl.ContentTransitions>
                <ContentControl.Content>
                    <Rectangle Height="200" Width="200" Fill="Orange" />
                </ContentControl.Content>
            </ContentControl>


            <!--
                如果要在 ScrollViewer 或其他繼承了 ContentControl 的控制項中應用 ContentThemeTransition 的話,應該用如下方式
            -->
            <ScrollViewer Name="scrollViewer" Margin="0 10 0 0" PointerPressed="scrollViewer_PointerPressed">
                <ContentControl Content="{Binding}">
                    <ContentControl.ContentTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Vertical">
                                <Rectangle Height="200" Width="200" Fill="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" />
                            </StackPanel>
                        </DataTemplate>
                    </ContentControl.ContentTemplate>
                    <ContentControl.ContentTransitions>
                        <TransitionCollection>
                            <ContentThemeTransition/>
                        </TransitionCollection>
                    </ContentControl.ContentTransitions>
                </ContentControl>
            </ScrollViewer>

        </StackPanel>
    </Grid>
</Page>

Animation/ThemeTransition/Content.xaml.cs

using System;
using Windows.UI;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;

namespace Windows10.Animation.ThemeTransition
{
    public sealed partial class Content : Page
    {
        public Content()
        {
            this.InitializeComponent();
        }

        // 改變 ContentControl 的內容
        private void contentControl_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            Rectangle rectangle = new Rectangle();
            Random random = new Random();

            rectangle.Height = 200;
            rectangle.Width = 200;
            rectangle.Fill = new SolidColorBrush(Color.FromArgb(255, (byte)random.Next(0, 255), (byte)random.Next(0, 255), (byte)random.Next(0, 255)));

            contentControl.Content = rectangle;
        }

        // 綁定最新的數據到 ScrollViewer
        private void scrollViewer_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            Random random = new Random();
            scrollViewer.DataContext = new SolidColorBrush(Color.FromArgb(255, (byte)random.Next(0, 255), (byte)random.Next(0, 255), (byte)random.Next(0, 255)));
        }
    }
}


4、演示 RepositionThemeTransition
Animation/ThemeTransition/Reposition.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Reposition"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <Button Name="btnMove" Content="移動 rectangle" Click="btnMove_Click" Margin="0 0 0 10" />

            <!--
                RepositionThemeTransition - 位置改變時的過渡效果
            -->
            <Rectangle Name="rectangle" Width="400" Height="100" Fill="Orange" HorizontalAlignment="Left">
                <Rectangle.Transitions>
                    <TransitionCollection>
                        <RepositionThemeTransition />
                    </TransitionCollection>
                </Rectangle.Transitions>
            </Rectangle>

        </StackPanel>
    </Grid>
</Page>

Animation/ThemeTransition/Reposition.xaml.cs

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Windows10.Animation.ThemeTransition
{
    public sealed partial class Reposition : Page
    {
        public Reposition()
        {
            this.InitializeComponent();
        }

        // 改變矩形的位置
        private void btnMove_Click(object sender, RoutedEventArgs e)
        {
            if (rectangle.Margin == new Thickness(0))
                rectangle.Margin = new Thickness(100);
            else
                rectangle.Margin = new Thickness(0);
        }
    }
}


5、演示 PopupThemeTransition
Animation/ThemeTransition/Popup.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Popup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <!--
                PopupThemeTransition - 彈出時的過渡效果
                    FromHorizontalOffset - 初始位置的水平偏移量
                    FromVerticalOffset - 初始位置的垂直偏移量
            -->
            <Popup Name="popup" HorizontalOffset="200" VerticalOffset="10" IsLightDismissEnabled="True">
                <Popup.Child>
                    <Border BorderBrush="Red" BorderThickness="1" Background="Blue" Width="200" Height="200">
                        <TextBlock Text="我是 Popup" HorizontalAlignment="Center" />
                    </Border>
                </Popup.Child>
                <Popup.ChildTransitions>
                    <TransitionCollection>
                        <PopupThemeTransition />
                    </TransitionCollection>
                </Popup.ChildTransitions>
            </Popup>

            <Button Name="btnPopup" Content="彈出 Popup" Click="btnPopup_Click" Margin="0 10 0 0" />

        </StackPanel>
    </Grid>
</Page>

Animation/ThemeTransition/Popup.xaml.cs

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Windows10.Animation.ThemeTransition
{
    public sealed partial class Popup : Page
    {
        public Popup()
        {
            this.InitializeComponent();
        }

        // 顯示 Popup
        private void btnPopup_Click(object sender, RoutedEventArgs e)
        {
            if (!popup.IsOpen)
                popup.IsOpen = true;
        }
    }
}


6、演示 AddDeleteThemeTransition
Animation/ThemeTransition/AddDelete.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.AddDelete"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <Button x:Name="btnAddItem" Content="Add Item" Click="btnAddItem_Click"/>
            <Button x:Name="btnDeleteItem" Content="Delete Item" Click="btnDeleteItem_Click" Margin="0 10 0 0" />

            <!--
                AddDeleteThemeTransition - 添加項或刪除項時的過渡效果
            -->
            <ItemsControl x:Name="itemsControl" Margin="0 10 0 0">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid>
                            <WrapGrid.ChildrenTransitions>
                                <TransitionCollection>
                                    <AddDeleteThemeTransition />
                                </TransitionCollection>
                            </WrapGrid.ChildrenTransitions>
                        </WrapGrid>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.Items>
                    <Rectangle Width="100" Height="100" Fill="Red" />
                    <Rectangle Width="100" Height="100" Fill="Green" />
                    <Rectangle Width="100" Height="100" Fill="Blue" />
                </ItemsControl.Items>
                <ItemsControl.Template>
                    <ControlTemplate>
                        <Border BorderBrush="Orange" BorderThickness="1">
                            <ItemsPresenter Margin="10" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        </Border>
                    </ControlTemplate>
                </ItemsControl.Template>
            </ItemsControl>

        </StackPanel>
    </Grid>
</Page>

Animation/ThemeTransition/AddDelete.xaml.cs

using System;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;

namespace Windows10.Animation.ThemeTransition
{
    public sealed partial class AddDelete : Page
    {
        public AddDelete()
        {
            this.InitializeComponent();
        }

        // 添加項
        private void btnAddItem_Click(object sender, RoutedEventArgs e)
        {
            Rectangle rectangle = new Rectangle();
            Random random = new Random();

            rectangle.Height = 100;
            rectangle.Width = 100;
            rectangle.Fill = new SolidColorBrush(Color.FromArgb(255, (byte)random.Next(0, 255), (byte)random.Next(0, 255), (byte)random.Next(0, 255)));

            itemsControl.Items.Add(rectangle);
        }

        // 刪除項
        private void btnDeleteItem_Click(object sender, RoutedEventArgs e)
        {
            if (itemsControl.Items.Count > 0)
                itemsControl.Items.RemoveAt(itemsControl.Items.Count - 1);
        }
    }
}


7、演示 ReorderThemeTransition
Animation/ThemeTransition/Reorder.xaml

<Page
    x:Class="Windows10.Animation.ThemeTransition.Reorder"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Windows10.Animation.ThemeTransition"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Transparent">
        <StackPanel Margin="10 0 10 10">

            <Button x:Name="btnAddItem" Content="Add Item" Click="btnAddItem_Click" />

            <!--
                ReorderThemeTransition - 對集合中的元素重新排序時的過渡效果
            -->
            <ItemsControl x:Name="itemsControl" Margin="0 10 0 0">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid>
                            <WrapGrid.ChildrenTransitions>
                                <TransitionCollection>
                                    <ReorderThemeTransition />
                                </TransitionCollection>
                            </WrapGrid.ChildrenTransitions>
                        </WrapGrid>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel<

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 一. 準備工作 下載nsis相關工具包,點擊此下載 1. 安裝程式:nsis-2.46-setup.exe 2. 編輯程式:cnisedit203.exe 3. 幫助文檔:NSIS205幫助文檔.rar 4. 第三方庫:ExecCmd.dll、AddPath.nsh、WriteEnvStr.nsh ...
  • 我們知道,現在能調試.net程式通常有兩個,第一個是ILSpy,還是一個是Reflector,這兩個小反編譯軟體算是我們研究底層代碼中所擁有的一把 鋒利小尖刀~~~,比如你看到的ILSpy這樣的界面圖: 但是呢!!! 用過ILSpy的同學大概都知道,這個毛軟體是調試不了web代碼的。。。也只能調試調 ...
  • 一直以來苦苦尋求適合自己的ORM,之前也用過Entity Framework、ormlite、nhibernate、dapper,都感覺準備步驟繁瑣,除非公司提前已經搭建起來一套成熟的框架,那樣只能做下添肉的工作,短時間內不能獨立搭建。--廢話終止 直接上圖: 就這麼簡單。 ...
  • 方法、函數、過程、靜態變數、類、結構體、構造函數、析構函數、運算符重載、索引器、類型轉換重載、嵌套類型 ...
  • 類 定義新的數據類型以及這些新的數據類型進行相互操作的方法 定義方式: C#中所有的類都是預設由object類派生來的,顯示指定或者省略效果是一樣的,所以上面的兩個例子是完全相同的。 C#中類包括:抽象類、密封類、非抽象類 abstract:表示修飾的類不完整,也就是抽象類,只能用做基類。 在使用是 ...
  • 本文目錄 Asp.net Core 對於授權的改動很友好,非常的靈活,本文以MVC為主,當然如果說webapi或者其他的分散式解決方案授權,也容易就可以實現單點登錄都非常的簡單,可以使用現成的IdentityServer框架或者自定義實現動非常方便和乾凈,如果你在運行示例代碼的時候未達到預期效果,請 ...
  • if語句、switch語句、Loops語句、Jump語句、格式輸出語句 ...
  • 在UWP淘寶與旺信中,筆者主要負責頁面與控制項的製作,這些工作看似簡單,但要想做的全面細緻仍然需要深入的思考。本文想分享一些在UWP旺信的製作過程中,筆者在UI頁面與控制項製作上體會到的一些心得。可能筆者的有些方法並不見得高明,或者仍需要時間的檢驗,所以也歡迎大家拍磚,共同進步。 UWP旺信是一個非常依 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...