Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Persist Security Info Property=true,Persist Security Info Property=false_C#_Database_Ms Access_Database Connection_Connection String - Fatal编程技术网

C# Persist Security Info Property=true,Persist Security Info Property=false

C# Persist Security Info Property=true,Persist Security Info Property=false,c#,database,ms-access,database-connection,connection-string,C#,Database,Ms Access,Database Connection,Connection String,有关物业: Persist Security Info=true 及 你能告诉我他们之间的区别吗?如果我不把它放在我的联系中,会发生什么 connect.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:/Users/Nourah/Downloads /Phase3/Salary.accdb;

有关物业:

Persist Security Info=true

你能告诉我他们之间的区别吗?如果我不把它放在我的联系中,会发生什么

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
Persist Security Info=false
这在前面不会有什么不同。这种差异发生在背景中

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

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

这就是区别


只有当您在连接字符串中提到用户名和密码时,设置
持久安全信息
true或false才会生效。如果在连接字符串中提到用户名和密码,并将
持久化安全信息设置为
false
,则无法提取凭据,但如果在连接字符串中提供凭据时将
持久化安全信息设置为true,windows将记住凭据,它可以通过编程方式提取。

我从Dan Guzman的SQL Server MVP中找到了这个答案:

我建议您指定FALSE或完全忽略关键字,因为它是 默认设置,即使在开发过程中也是如此。你唯一需要的时候 如果应用程序使用SQL身份验证和 随后从连接对象检索密码,该对象 根据我的经验,这是很少做或需要的。表演不是一种娱乐 担心


可能是重复的,但我在应用代码时没有仔细理解,相同的结果不确定在ms Access中使用Persist Security Info是否有任何意义因此如果我想将其设置为true,我将如何编写连接代码???@Nourah设置为true或false仅当您在连接字符串中提及用户名和密码时才会生效..如果您在connectionstring中提及用户名和密码并将其设置为false则无法提取凭据..但如果在connectionstring窗口中提供凭据时设置为true,则windows将记住凭据,并且可以在pgm中提取凭据…请参阅编辑的答案“则无法提取凭据..”,通过什么,源代码?什么是赞成和反对,以及当有人需要将其设置为真时的一个简单场景?pgm意味着什么?@eaglei22,.net entity framework的DbContext用户可能希望提取连接字符串,以便创建其他连接以用于较低级别的操作,如SqlBulkCopy。
connect.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;
                            Data Source=C:/Users/Nourah/Downloads 
                            /Phase3/Salary.accdb; 
                            Persist Security Info=False;";