在c#中安全连接到mySQL数据库 [英] Safely connect to mySQL database in c#

查看:78
本文介绍了在c#中安全连接到mySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 C# 还是很陌生,我一直在做很多东西,但我缺少很多基础知识.无论如何,我正在制作一个程序,用户必须登录,然后检查输入的密码是否与数据库中的密码相同.

无论如何,我知道有办法进入编译程序的代码,我想知道我是否应该做些什么来确保没有人能以某种方式看到 MySQL 数据的登录信息.

谢谢

解决方案

您可以通过多种不同的方式保护连接信息,具体取决于您的规格和要求.

一个简单的规则,永远不要在编译代码中包含数据库连接字符串!!!

部分链接
保护连接信息
SO - 在非 ASP.Net 应用程序中加密连接字符串
MSDN 保护连接字符串

进一步对评论中提出的问题.
除了 ANY 连接字符串配置之外,您还应该使用 Role Base Access Control 来限制应用程序对数据库的访问 将授予应用程序的权限以及它可以执行的过程或 Sql 命令减少到最低限度.

I'm pretty new to C#, I've been doing a bunch of stuff but I'm missing a lot of basics. Anyways, I'm making a program where the user has to log in and and then it checks if the entered password is the same as the one on the database.

Anyways, I know that there's ways to get get into the code of a compiled program and I wanted to know if there's anything I should do to make sure that nobody can see the login info of the MySQL data somehow.

Thanks

解决方案

There are many different ways you can Protect Connection Information depending on your specifications and requirements.

One simple rule, never include database connection strings in compiled code!!!

Some Links
Protect Connection Information
SO - Encrypt connection string in NON ASP.Net applications
MSDN Securing Connection Strings

Further to a questions raised in the comments.
Secondary to ANY connection string configuration you should also limit the applications access to the Database by using Role Base Access Control to reduce the permissions granted to the application and the procedures or Sql commands it can execute to a bare minimum.

这篇关于在c#中安全连接到mySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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