.NET2.0 中的项目格式验证
我需要验证下面的每个项目格式。假设用户一次只输入一个值,我必须找出他/她输入的格式。我有什么容易接近的方法吗?
感谢您的建议和意见。
已安装.NET 2.0。使用 C#。
2 byte character
8 byte integer (signed)
1 byte integer (signed)
2 byte integer (signed)
4 byte integer (signed)
8 byte floating point
4 byte floating point
8 byte integer (unsigned)
1 byte integer (unsigned)
2 byte integer (unsigned)
4 byte integer (unsigned)
I need to validate each of item formats below. Suppose user input Only One value a time, I must find out which format he/her input. I there any easy to approach it?
Thanks for your suggestions and comments.
.NET 2.0 installed. C# Used.
2 byte character
8 byte integer (signed)
1 byte integer (signed)
2 byte integer (signed)
4 byte integer (signed)
8 byte floating point
4 byte floating point
8 byte integer (unsigned)
1 byte integer (unsigned)
2 byte integer (unsigned)
4 byte integer (unsigned)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用以下所有类型的
TryParse
静态方法:对于字符,您必须更具体 - 您是否希望按字符转换输入(例如,如果他们输入
5
,则字符值将为 53,即代表数字 5 的 ASCII 值),或者按值(例如,他们必须输入53
才能生成数字5)?Use the
TryParse
static methods of all of the following types:For characters, you will have to be more specific -- do you want the input converted by character (e.g. if they enter
5
the character value will be 53, the ASCII value representing the digit 5), or by value (e.g. they would have to enter53
to produce the digit 5)?