password属性text和datatype(datatype.password)属性之间的差异是什么? [英] What is the dfference between password property text and datatype(datatype.password) attributes

查看:495
本文介绍了password属性text和datatype(datatype.password)属性之间的差异是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是DataType DataType.Password属性和密码属性文本属性 做同样的事情 或者在使用什么时候它是不同的 ? 



  code 

        [PasswordPropertyText]

        [DataType(DataType.Password)]

        public string密码{get;组; }

Is DataType DataType.Password attribute and Password Property Text attribute  do the same thing  or is it different when to use what   ? 

 code 
        [PasswordPropertyText]
        [DataType(DataType.Password)]
        public string Password { get; set; }

推荐答案

嗨  VimalTom,

感谢您在此发帖。

>> [PasswordPropertyText]

我们总是使用放置的PasswordPropertyTextAttribute属性在属性或类型上,其在属性窗口中的文本表示显示为点或星号以指示密码字段。

>> [DataType(DataType.Password)]

DataType.Password用于r epresent密码值。请查看下面的链接。

https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.datatype?view=netframework-4.7.2

最诚挚的问候,

Wendy


这篇关于password属性text和datatype(datatype.password)属性之间的差异是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆