douwen7603 2016-08-11 08:24
浏览 141

安全地连接到c#中的数据库服务器

Through research i cant seem to find the best approach, I am making a WPF application and want all users to connect to my database server.

However I don't wish to have the connection details (IP Address, database password) stored on the application. i am currently playing around with PHP as the bridge between.

I have a database server on a domain. I am connecting through HttpClient and getting a response via a JSON file. However i am concerned as the file can be accessed from anywhere. for example my url is www.domian.co.uk/scores.php. to increase security i have add a parameter in the StringContent which will only work if this is set. Could i also use .htaccess to prevent the file being seen or would this have an effect on my HttpClient.

var httpClient = new HttpClient();
response = await httpClient.PostAsync(uri, new StringContent(data));

option 2 An alternative i have been looking into but have test due to pricing is Windows Azure. I believe this would be a good alternative as alot of the backend work has been done for me. From this article, you can get the Connection String for your azure service and use System.Data.SqlClient to make database queries. However the Connection string still requires your password to be included, is this secure including the password or do i need to create a separate DB user with strict permissions?

option 3 From research another option would be to use WCF.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教