-
Notifications
You must be signed in to change notification settings - Fork 255
VerifyCode
闫驚鏵(Jinhua Yan) edited this page Jul 9, 2023
·
3 revisions
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Button Style="{StaticResource WD.SuccessPrimaryButton}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Click="Button_Click"
Content="获取"/>
<UniformGrid Rows="2" Columns="2" Grid.Row="1">
<wd:VerifyCode Foreground="LimeGreen" Name="VerifyCode1"/>
<wd:VerifyCode Foreground="Red" Name="VerifyCode2"/>
<wd:VerifyCode Foreground="DodgerBlue" Name="VerifyCode3"/>
<wd:VerifyCode Foreground="HotPink" Name="VerifyCode4"/>
</UniformGrid>
</Grid>
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
var stringBuilder = new StringBuilder();
stringBuilder.AppendLine($"获取到验证码如下:");
stringBuilder.AppendLine(VerifyCode1.VerifyCodeText);
stringBuilder.AppendLine(VerifyCode2.VerifyCodeText);
stringBuilder.AppendLine(VerifyCode3.VerifyCodeText);
stringBuilder.AppendLine(VerifyCode4.VerifyCodeText);
WPFDevelopers.Controls.MessageBox.Show(stringBuilder.ToString(),
"验证码",
System.Windows.MessageBoxButton.OK,
System.Windows.MessageBoxImage.Information);
}