从WinForms应用程序天青SQL安全连接字符串 [英] Secure connection string from winforms app to Azure SQL

查看:110
本文介绍了从WinForms应用程序天青SQL安全连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在升级与一些移动客户端现有的winform应用程序和真的很想把SQL Azure的进入而不是当前本地SQL的解决方案。然后我会更改app.config文件指向Azure的连接字符串。

I am working on upgrading an existing winform app with some mobile clients and would really like to put the SQL into Azure instead of the current local SQL solution. I would then change the connection string in the app.config file to point to Azure.

目前我最关心的问题目前是安全问题,所以我想确保连接字符串(通过加密...),所以它不能在本地app.config文件中查看。

At present one of my biggest concerns is security and therefore I would like to secure the connection string (through encryption...) so that it can't be viewed locally in the app.config file.

有谁知道我应该如何去了解一些加密或全部app.config文件到键连接字符串的视线我们。我假设,因为SQL Azure的使用SSL我不需要太担心它是如何安全当请求实际上是被从winform应用程序天青的。

Does anyone know how I should go about encrypting some or all of the app.config file to key the connection string our of sight. I have assumed that since Azure SQL uses SSL I don't need to worry too much about how secure it is when the request is actually being made from the winform app to Azure.

任何帮助非常赞赏。

贾森。

推荐答案

警告:这不是一个节省的解决方案

您可以将您的凭据在一个加密文件,然后通过读取连接到数据库和解密! 。凭据从该文件

You can store your credentials in an encrypted file and then connect to the database by reading and decrypt the credentials from that file.

教程文件加密看看这里

连接到数据库:

string connectionString = myconnectionstringReadedFromFile;

//
// In a using statement, acquire the SqlConnection as a resource.
//
using (SqlConnection con = new SqlConnection(myconnectionstringReadedFromFile))
{
    //
    // Open the SqlConnection.
    //
    con.Open();

    //.... your stuff

}

这篇关于从WinForms应用程序天青SQL安全连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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