How can I hide my password in my C# Connection string?

后端 未结 5 1970
时光取名叫无心
时光取名叫无心 2020-12-03 11:11

I have the following connection string:

Data Source=Paul-HP\\MYDB;Initial Catalog=MyMSDBSQL;Persist Security Info=True;User ID=sa;Password=password
         


        
5条回答
  •  悲&欢浪女
    2020-12-03 11:40

    First of all, don't use the "SA" account. It leaves your database wide open if someone gets the password. Use a custom account which only is allowed to do CRUD operations on a specific database.

    The only way to get web.config is to hack your server. And if they have done that, you're screwed anyway.

提交回复
热议问题