本文介绍了如果用户同时输入十六进制和十进制值,则进行数据验证.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
在我的WPF应用程序中,我需要验证从十六进制到dec格式的数据,
My.Xaml
< TextBox Grid.Column ="0" Grid.Row ="1" Name ="ErrorList" Horizo​​ntalAlignment ="Left" VerticalAlignment ="Center"> ErrorList</TextBox>
我有一个按钮启动扫描"
My.Xaml.cs
....
....
int MyFunction_InitiateScan(int value)
{

_ScanValue.ErrorList = Convert.ToByte(ErrorList.Text);//如果给定十进制值,它将验证数据.

......
}
我需要验证用户给出的数据的十进制范围(0-7)和十六进制dec(0x-0x7),在wpf中是否有等效的转换和验证来处理上述情况.
如果给出的值超出上述指定范围,则应显示无效数据.我该如何调整以上功能.
在此先感谢.
问候,
Samanth_90

Hi All,
In my WPF Application, I need to validate the data from hex to dec format,
My.Xaml
<TextBox Grid.Column ="0" Grid.Row="1" Name="ErrorList" HorizontalAlignment="Left" VerticalAlignment="Center">ErrorList</TextBox>
I have a button "Initiate Scan"
My.Xaml.cs
....
....
int MyFunction_InitiateScan(int value)
{

_ScanValue.ErrorList= Convert.ToByte(ErrorList.Text);//This validates the data if given decimal value.

......
}
I need to validate the data given by user in decimal range (0- 7) and Hex-dec(0x-0x7), Is there a equivalent conversion and validation in wpf to handle the above scenario.
If given beyond the above specified range it should display Invalid data . how could I tweak the above function.
Thanks in Advance.
With Regards,
Samanth_90

推荐答案


这篇关于如果用户同时输入十六进制和十进制值,则进行数据验证.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 08:40