WPF 基础控件之 Slider 样式

其他基础控件

1.Window
2.Button
3.CheckBox
4.ComboBox
5.DataGrid
6.DatePicker
7.Expander
8.GroupBox
9.ListBox
10.ListView
11.Menu
12.PasswordBox
13.TextBox
14.RadioButton
15.ToggleButton

Slider  实现下面的效果

d25d10c0271ddad774aca051611d2030.png

1)Slider来实现动画;

  • Grid嵌套 Border并设置ScaleTransform ,当鼠标移入MouseOverScaleTransform.ScaleX 与 ScaleTransform.ScaleYTo = 1.2 放大;

  • Orientation设置为Horizontal水平方向走SliderHorizontal

  • Orientation设置为Vertical垂直方向走SliderVertical

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:sys="clr-namespace:System;assembly=mscorlib"><ResourceDictionary.MergedDictionaries><ResourceDictionary Source="../Themes/Basic/ControlBasic.xaml"/><ResourceDictionary Source="../Themes/Basic/Animations.xaml"/></ResourceDictionary.MergedDictionaries><sys:Double x:Key="ThumbWidth">16</sys:Double><sys:Double x:Key="ThumbCornerRadius">8</sys:Double><sys:Double x:Key="RepeatButtonSize">5</sys:Double><ControlTemplate x:Key="SliderThumbHorizontalTop" TargetType="{x:Type Thumb}"><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryPressedSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}"SnapsToDevicePixels="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8" Margin="-1,0,0,0"Name="PART_Border" RenderTransformOrigin=".5,.5"></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="RenderTransform" TargetName="PART_Border"><Setter.Value><ScaleTransform  ScaleX="1.2" ScaleY="1.2"/></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderThumbHorizontalBottom" TargetType="{x:Type Thumb}"><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}"SnapsToDevicePixels="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8" Margin="-1,0,0,0"Name="PART_Border" RenderTransformOrigin=".5,.5"></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="RenderTransform" TargetName="PART_Border"><Setter.Value><ScaleTransform  ScaleX="1.2" ScaleY="1.2"/></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderThumbHorizontal" TargetType="{x:Type Thumb}"><ControlTemplate.Resources><!--<Storyboard x:Key="ThumbMouseOut"><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"To="1" Duration="00:00:0.1"/><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"To="1" Duration="00:00:0.1"/></Storyboard>--><Storyboard x:Key="ThumbMouseOver"><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"From="1"To="1.2" Duration="00:00:0.1"/><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"From="1"To="1.2" Duration="00:00:0.1"/></Storyboard></ControlTemplate.Resources><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource WindowForegroundColorBrush}"SnapsToDevicePixels="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8" Margin="-1,0,0,0"Name="PART_Border" RenderTransformOrigin=".5,.5"><Border.RenderTransform><ScaleTransform/></Border.RenderTransform></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Trigger.EnterActions><BeginStoryboard x:Name="BeginStoryboard"  Storyboard="{StaticResource ThumbMouseOver}" /></Trigger.EnterActions><Trigger.ExitActions><StopStoryboard BeginStoryboardName="BeginStoryboard"/><!--<BeginStoryboard Storyboard="{StaticResource ThumbMouseOut}" />--></Trigger.ExitActions></Trigger></ControlTemplate.Triggers></ControlTemplate><Style x:Key="RepeatButtonTransparent" TargetType="{x:Type RepeatButton}"><Setter Property="OverridesDefaultStyle" Value="True"/><Setter Property="Background" Value="Transparent"/><Setter Property="Focusable" Value="False"/><Setter Property="IsTabStop" Value="False"/><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type RepeatButton}"><Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/><!--<Border Background="{TemplateBinding Background}"Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"CornerRadius="4,4,0,0"/>--></ControlTemplate></Setter.Value></Setter></Style><ControlTemplate x:Key="SliderThumbHorizontalDefault" TargetType="{x:Type Thumb}"><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}"SnapsToDevicePixels="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8" Margin="-1,0,0,0"Name="PART_Border" RenderTransformOrigin=".5,.5"></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="RenderTransform" TargetName="PART_Border"><Setter.Value><ScaleTransform  ScaleX="1.2" ScaleY="1.2"/></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderHorizontal" TargetType="{x:Type Slider}"><Border x:Name="border"BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"Padding="2"><Grid><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/><RowDefinition Height="Auto"/></Grid.RowDefinitions><TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,0,0,2" Placement="Top" Grid.Row="0" Visibility="Collapsed"/><TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,2,0,0" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/><Border x:Name="TrackBackground" Height="6.0" Margin="5,0" Grid.Row="1" VerticalAlignment="center"><Canvas Margin="-6,-1"><Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Height="4.0" Visibility="Hidden"/></Canvas></Border><Track x:Name="PART_Track" Grid.Row="1"><Track.DecreaseRepeatButton><RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{DynamicResource RepeatButtonTransparent}" Background="{DynamicResource PrimaryNormalSolidColorBrush}" Height="{StaticResource RepeatButtonSize}"/></Track.DecreaseRepeatButton><Track.IncreaseRepeatButton><RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"Background="{DynamicResource LightSolidColorBrush}" Height="{StaticResource RepeatButtonSize}"/></Track.IncreaseRepeatButton><Track.Thumb><Thumb x:Name="Thumb" Focusable="False" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbHorizontal}" VerticalAlignment="Center"/></Track.Thumb></Track></Grid></Border><ControlTemplate.Triggers><Trigger Property="TickPlacement" Value="TopLeft"><Setter Property="Visibility" TargetName="TopTick" Value="Visible"/><Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontal}"/><Setter Property="Margin" TargetName="TrackBackground" Value="5,2,5,0"/></Trigger><Trigger Property="TickPlacement" Value="BottomRight"><Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/><Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbHorizontal}"/><Setter Property="Margin" TargetName="TrackBackground" Value="5,0,5,2"/></Trigger><Trigger Property="TickPlacement" Value="Both"><Setter Property="Visibility" TargetName="TopTick" Value="Visible"/><Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/></Trigger><Trigger Property="IsSelectionRangeEnabled" Value="True"><Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/></Trigger><Trigger Property="IsKeyboardFocused" Value="True"><Setter Property="Foreground" TargetName="Thumb" Value="{DynamicResource PrimaryNormalSolidColorBrush}"/></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderThumbVerticalLeft" TargetType="{x:Type Thumb}"><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}"SnapsToDevicePixels="True" UseLayoutRounding="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8"Name="PART_Border" RenderTransformOrigin=".5,.5"></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="RenderTransform" TargetName="PART_Border"><Setter.Value><ScaleTransform  ScaleX="1.2" ScaleY="1.2"/></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderThumbVerticalRight" TargetType="{x:Type Thumb}"><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}"SnapsToDevicePixels="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8"Name="PART_Border" RenderTransformOrigin=".5,.5"></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="RenderTransform" TargetName="PART_Border"><Setter.Value><ScaleTransform  ScaleX="1.2" ScaleY="1.2"/></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderThumbVerticalDefault" TargetType="{x:Type Thumb}"><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}" SnapsToDevicePixels="True" UseLayoutRounding="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8" Margin="0,0,0,-1"Name="PART_Border" RenderTransformOrigin=".5,.5"></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="RenderTransform" TargetName="PART_Border"><Setter.Value><ScaleTransform  ScaleX="1.2" ScaleY="1.2"/></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderThumbVertical" TargetType="{x:Type Thumb}"><ControlTemplate.Resources><!--<Storyboard x:Key="ThumbMouseOut"><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"To="1" Duration="00:00:0.1"/><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"To="1" Duration="00:00:0.1"/></Storyboard>--><Storyboard x:Key="ThumbMouseOver"><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"From="1"To="1.2" Duration="00:00:0.1"/><DoubleAnimation Storyboard.TargetName="PART_Border"Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"From="1"To="1.2" Duration="00:00:0.1"/></Storyboard></ControlTemplate.Resources><Grid HorizontalAlignment="Center" UseLayoutRounding="True" VerticalAlignment="Center"><Border BorderBrush="{DynamicResource PrimaryNormalSolidColorBrush}" BorderThickness="2" Background="{DynamicResource BackgroundSolidColorBrush}" SnapsToDevicePixels="True" UseLayoutRounding="True"Height="{StaticResource ThumbWidth}" Width="{StaticResource ThumbWidth}" CornerRadius="8" Margin="0,0,0,-1"Name="PART_Border" RenderTransformOrigin=".5,.5"><Border.RenderTransform><ScaleTransform/></Border.RenderTransform></Border></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Trigger.EnterActions><BeginStoryboard x:Name="BeginStoryboard" Storyboard="{StaticResource ThumbMouseOver}" /></Trigger.EnterActions><Trigger.ExitActions><StopStoryboard BeginStoryboardName="BeginStoryboard"/><!--<BeginStoryboard Storyboard="{StaticResource ThumbMouseOut}" />--></Trigger.ExitActions></Trigger></ControlTemplate.Triggers></ControlTemplate><ControlTemplate x:Key="SliderVertical" TargetType="{x:Type Slider}"><Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"Padding="2"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions><TickBar x:Name="TopTick" Grid.Column="0" Fill="{TemplateBinding Foreground}" Margin="0,0,2,0" Placement="Left" Visibility="Collapsed" Width="4"/><TickBar x:Name="BottomTick" Grid.Column="2" Fill="{TemplateBinding Foreground}" Margin="2,0,0,0" Placement="Right" Visibility="Collapsed" Width="4"/><Border x:Name="TrackBackground" HorizontalAlignment="center" Margin="0,5"Width="6.0"><Canvas Margin="-1,-6"><Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Visibility="Hidden" Width="4.0"/></Canvas></Border><Track x:Name="PART_Track" Grid.Column="1"><Track.DecreaseRepeatButton><RepeatButton Command="{x:Static Slider.DecreaseLarge}"Style="{StaticResource RepeatButtonTransparent}"Background="{DynamicResource PrimaryNormalSolidColorBrush}" Width="{StaticResource RepeatButtonSize}"/></Track.DecreaseRepeatButton><Track.IncreaseRepeatButton><RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonTransparent}"Background="{DynamicResource LightSolidColorBrush}" Width="{StaticResource RepeatButtonSize}"/></Track.IncreaseRepeatButton><Track.Thumb><Thumb x:Name="Thumb" Focusable="False" OverridesDefaultStyle="True" Template="{StaticResource SliderThumbVertical}" VerticalAlignment="Top"/></Track.Thumb></Track></Grid></Border><ControlTemplate.Triggers><Trigger Property="TickPlacement" Value="TopLeft"><Setter Property="Visibility" TargetName="TopTick" Value="Visible"/><Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVertical}"/><Setter Property="Margin" TargetName="TrackBackground" Value="2,5,0,5"/></Trigger><Trigger Property="TickPlacement" Value="BottomRight"><Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/><Setter Property="Template" TargetName="Thumb" Value="{StaticResource SliderThumbVertical}"/><Setter Property="Margin" TargetName="TrackBackground" Value="0,5,2,5"/></Trigger><Trigger Property="TickPlacement" Value="Both"><Setter Property="Visibility" TargetName="TopTick" Value="Visible"/><Setter Property="Visibility" TargetName="BottomTick" Value="Visible"/></Trigger><Trigger Property="IsSelectionRangeEnabled" Value="True"><Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/></Trigger></ControlTemplate.Triggers></ControlTemplate><Style TargetType="{x:Type Slider}" BasedOn="{StaticResource ControlBasicStyle}"><Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/><Setter Property="Background" Value="Transparent"/><Setter Property="BorderBrush" Value="Transparent"/><Setter Property="Cursor" Value="Hand"/><Setter Property="Foreground" Value="{DynamicResource PrimaryNormalSolidColorBrush}"/><Setter Property="Template" Value="{StaticResource SliderHorizontal}"/><Style.Triggers><Trigger Property="Orientation" Value="Vertical"><Setter Property="Template" Value="{StaticResource SliderVertical}"/></Trigger><!--<Trigger Property="IsEnabled" Value="False"><Setter Property="Opacity" Value="{StaticResource EnabledOpacity}" /></Trigger>--></Style.Triggers></Style></ResourceDictionary>

2)Styles.Slider.xaml 代码如下;

<WrapPanel Margin="0,10"><Slider Width="200"/><Slider Width="200" Value="50" Maximum="100"  Margin="10,0"/><Slider Width="200" Value="50" Maximum="100" IsEnabled="False"/></WrapPanel>

Nuget[1]Install-Package WPFDevelopers.Minimal

06427f713a147ec038891624927c754b.gif

[2][3]

参考资料

[1]

Nuget: https://www.nuget.org/packages/WPFDevelopers.Minimal/

[2]

GitHub: https://github.com/WPFDevelopersOrg

[3]

Gitee: https://gitee.com/WPFDevelopersOrg

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/286435.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SQL 通过syscolumns.xtype动态查找指定数据类型字段所包含的数据

表中太多列&#xff0c;只想查找某些比如&#xff0c;数据类型为varchar的字段的数据。 思路&#xff1a;1、先获取列名&#xff1a; select * from syscolumns where id(select max(id) from sysobjects where xtypeu and nametest_A)2、查找指定数据类型&#xff0c;xtype就…

css案例学习之span边框实现的特殊效果

bottom left bottom right top left top right 配合颜色来使用&#xff0c;实现一些神奇的效果 #menu a span{height:0;width:0;/*border-top:solid 6px #fff;border-left:solid 6px #f90;*//*border-top:solid 6px #fff;border-right:solid 6px #f90;*//*border-bottom:solid …

网页版消消乐快速实现,无代码吗iVX 真那么简单?

最近没事想做个消消乐&#xff0c;然后听说 iVX 免费了&#xff0c;所以又跑去看看 iVX 了&#xff0c;就用一个无代码来看看消消乐怎么玩吧。 首先咱们打开 iVX 的在线编辑器&#xff1a;https://editor.ivx.cn/ 随后咱们不需要游戏类型也可以制作一个消消乐游戏&#xff1a…

虚拟化记录--No.1

近段时间&#xff0c;会花些时间做关于系统虚拟化的工作。所以会做一些这样的记录。相信很多东西不会特别成体系&#xff0c;每个人因为关注的不同而记录和学习的重点也会有比较大的出入。这篇是NO.1(注意不是TOP 1 )真的是由于对于ORACLE很有感觉&#xff0c;所以上手去做的也…

C语言试题三之计算并输出 s=1+(1+2^(0.5))+(1+2^(0.5)+3^(0.5))+…+(1+2^(0.5)+3^(0.5)+…+n^(0.5))

📃个人主页:个人主页 🔥系列专栏:C语言试题200例目录 💬推荐一款刷算法、笔试、面经、拿大公司offer神器 👉 点击跳转进入网站 ✅作者简介:大家好,我是码莎拉蒂,CSDN博客专家(全站排名Top 50),阿里云博客专家、51CTO博客专家、华为云享专家 1 、题目 请编写函…

C# Java间进行RSA加密解密交互

这里&#xff0c;讲一下RSA算法加解密在C#和Java之间交互的问题&#xff0c;这两天纠结了很久&#xff0c;也看了很多其他人写的文章&#xff0c;颇受裨益&#xff0c;但没能解决我的实际问题&#xff0c;终于&#xff0c;还是被我捣鼓出来了。 首先&#xff0c;介绍一下写这代…

【Microstation】三维建模基础及软件入门到精通实验教程目录

文章目录1. 专栏简介2. 专栏地址3. 专栏目录1. 专栏简介 MicroStation是一款非常不错的二维和三维设计软件&#xff0c;由奔特力&#xff08;Bentley&#xff09;工程软件系统有限公司开发的一款软件。在CAD设计上该软件是和AutoCAD是齐名的软件&#xff0c;其专用的文件格式是…

无代码iVX编程实现简单魂斗罗

首先咱们打开 iVX 的在线编辑器&#xff1a;https://editor.ivx.cn/ 随后咱们选择2D游戏类型制作一个简单魂斗罗游戏&#xff1a; 随后咱们开始创建一个物理世界&#xff0c;不并且在物理世界之下创建一个一个图片添加物体属性&#xff0c;在物体属性中更改对应的属性内容&am…

【ArcGIS遇上Python】ArcGIS Python批处理入门到精通实用教程目录

文章目录1. 专栏简介2. 专栏地址3. 专栏目录1. 专栏简介 Python语言是目前很火热的语言&#xff0c;极大的促进了人工智能发展。你知道在ArcGIS中也会有python的身影吗&#xff1f;事实上&#xff0c;在ArcGIS中使用Python会起到事半功倍的效果&#xff0c;大大提高工作效率&am…

Android之提示javax.net.ssl.SSLHandshakeException: Chain validation failed

1、问题 个别手机用OkDownload下载Bilibili网址视频的时候下载失败,但是大部分手机下载没问题。 在继承的DownloadListener4WithSpeed类的重写taskEnd函数里面。 override fun taskEnd(task: DownloadTask, cause: EndCause, realCause: Exception?, taskSpeed: SpeedCalcu…

c# XML和实体类之间相互转换(序列化和反序列化)

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Data; using System.Xml; using System.Xml.Serialization; /// <summary>/// Xml序列化与反序列化/// </summary>public class XmlUtil {…

深入探究MinimalApi是如何在Swagger中展示的

前言之前看到技术群里有同学讨论说对于MinimalApi能接入到Swagger中感到很神奇,加上Swagger的数据本身是支持OpenApi2.0和OpenApi3.0使得swagger.json成为了许多接口文档管理工具的标准数据源。ASP.NET Core能够轻松快速的集成Swagger得益于微软对OpenApi的大力支持&#xff0c…

语句的输入、输出

一、C#基础 1、项目后缀&#xff1a; .config——配置文件&#xff08;存放配置参数文件&#xff09; .csproj——项目文件&#xff08;管理文件项&#xff09; .sln——解决方案文件&#xff08;管理项目&#xff09; .cs——源文件&#xff08;程序代码&#xff09; 2、函数四…

Samba平台搭建和用户自行修改密码环境搭建笔记

Samba 平台搭建和用户自行修改密码环境搭建笔记系统&#xff1a;CentOS release 6.5 (Final)x86_64软件: samba #服务端samba-client #客户端samba-common #通用工具和库Apache:httpdWeb: changepassword-0.9.tar.gz #需 GCC 编译源码包&#…

Android使用C/C++来保存密钥

Android使用C/C来保存密钥本文主要介绍如何通过native方法调用取出密钥&#xff0c;以替代原本直接写在Java中&#xff0c;或写在gradle脚本中的不安全方式。为什么要这么做 如果需要在本地存储一个密钥串&#xff0c;典型的方式有 1. 直接写在java source code中 2. 写在gradl…

无代码iVX编程实现简单跳跃超级玛丽游戏

首先咱们打开 iVX 的在线编辑器&#xff1a;https://editor.ivx.cn/ 随后咱们选择2D游戏类型制作一个简单跳跃游戏&#xff1a; 接下来创建几个图片&#xff0c;并且添加物体&#xff0c;如图所示&#xff1a; 在此需要更改对应称重地面的阻尼值&#xff0c;让其能够缓慢降落…

【三维激光扫描】实验01:环境搭建CAD2014+StonexSiScan软件安装

目 录 一、CAD2014简体中文版安装1. 安装过程2. 激活过程二、Si-Scan安装1. 主程序安装2. 驱动安装一、CAD2014简体中文版安装 1. 安装过程 双击安装包:AutoCAD_2014_Simplified_Chinese_Win_64bit_dlm.sfx.exe,进行自解压。 解压完成后,如下图所示,点击【安装】。 接受许…

C# 11 新特性:原始字符串

之前我们经常需要使用 string 类型定义字符串文本&#xff0c;字符串文本用一对双引号括起来表示&#xff1a;var str "Hello MyIO";字符串可包含任何字符文本&#xff0c;但是有些字符需要转义才能表示&#xff0c;比如双引号要转义成\"&#xff1a;var str …

File,FileInfo,Directory,DirectoryInfo

两者的共同点&#xff1a; 一&#xff1a;都用于典型的操作&#xff0c;如复制、移动、重命名、创建、打开、删除和追加到文件 二&#xff1a;默认情况下&#xff0c;将向所有用户授予对新文件的完全读/写访问权限。 两者的区别&#xff1a; File类是静态类&#xff0c;由…

C语言试题四之计算并输出3到n之间所有素数的平方根之和

📃个人主页:个人主页 🔥系列专栏:C语言试题200例目录 💬推荐一款刷算法、笔试、面经、拿大公司offer神器 👉 点击跳转进入网站 ✅作者简介:大家好,我是码莎拉蒂,CSDN博客专家(全站排名Top 50),阿里云博客专家、51CTO博客专家、华为云享专家 1、题目 请编写函数…