持久安全信息属性 = true 和持久安全信息属性 = false

2023-12-20

对于属性:

Persist Security Info=true

and

Persist Security Info=false

你能告诉我它们之间有什么区别吗?如果我不把它放在我的连接中会发生什么?

connect.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;
                            Data Source=C:/Users/Nourah/Downloads 
                            /Phase3/Salary.accdb; 
                            Persist Security Info=False;";

即使你设置了Persist Security Info=true OR Persist Security Info=false它不会预先显示出差异。差异发生在后台。

When Persist Security Info=False, 安全敏感 诸如密码之类的信息不会作为信息的一部分返回 连接(如果连接已打开或曾经处于打开状态) 状态。

如果你设置Persist Security Info=True,Windows会记住连接字​​符串中指定的密码。

这就是区别。

MSDN解释 https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring?view=netframework-4.8#remarks

Setting Persist Security Info仅当您在连接字符串中提及用户名和密码时,true 或 false 才会生效。如果您在连接字符串中提及用户名和密码并设置Persist Security Info as false那么无法提取凭据,但如果您设置Persist Security Info当在连接字符串中提供凭据时为 true,Windows 将记住凭据,并且可以通过编程方式提取它。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

持久安全信息属性 = true 和持久安全信息属性 = false 的相关文章

随机推荐