This is the link string I used to encrypt, which can also query the data without throwing any exceptions.
Original writing:
web.config
The above is the default writing, and the following is the encrypted writing.
We can write the connection string directly into the parent class construction method, since we can write the connection string directly into it,
In other words, we write the encrypted connection string to the appsettings of web.config, and then we take out the value according to the key.
Wouldn't it be enough for us to write another method to decrypt it into the correct connection string???
I wrote this article because last week someone in the QQ group asked EF how to encrypt the link string, and then the members of the group offered suggestions, some people said this, some people said that, and each had their own opinions.
In the end, it seemed that it had been done for more than half an hour, and the group was still discussing, but today, suddenly, I wanted to try it myself, and as a result, I got it done in a minute。。。。。。。
|