如何在文本文件连接字符串中加密和解密密码 [英] How To Encrypt and Decrypt password in Text File connection string

查看:210
本文介绍了如何在文本文件连接字符串中加密和解密密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示错误:
Base-64字符串中的字符无效。

如何获得pass,ds,db当写文字Textfile时,uid值。请帮助我

这个我的代码

展开 | 选择 | Wrap | 行号

解决方案

第22行需要在第23行内。


您还需要确保加密方法返回base64格式的字符串,因为它看起来像解密方法需要base64输入。如果没有,你需要先加密输出并将其格式化为base64。


但我不知道你是如何加密它而不提供密码的。

这是我的问题我不知道如何加密提供密码。请给我答案


嘿mohammed saleh,保护你的连接字符串,将你的连接字符串存储在app.config / web.config文件中(取决于你的项目)然后加密/解密它使用 ProtectedConfigurationProvider 。有关详细信息,请参阅以下链接。

保护连接字符串


Show Error :
Invalid character in a Base-64 string.
How Can I get pass,ds,db,uid the value when writeline Textfile.Please help me
this my code

Expand|Select|Wrap|Line Numbers

解决方案

Line 22 needs to be inside line 23.

You also need to make sure that the encryption method returns a base64 formatted string because it looks like the decryption method expects a base64 input. If not, you will need to take the encryption output and format it to base64 first.

But I don''t understand how you are encrypting it without supplying a password.


This my problem " I don''t know how encrypting it supplying a password." please give me the answer


Hey mohammed saleh, to protect your connection string, store your connection string in app.config/web.config file (depending on your project) then encrypt/decrypt it using "ProtectedConfigurationProvider". Refer the following link for more information.

Securing Connection Strings


这篇关于如何在文本文件连接字符串中加密和解密密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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