【发布时间】:2017-12-13 17:59:45
【问题描述】:
我目前正在使用 Xamarin 开发跨平台应用程序。 用户可以登录并注册,为此我需要连接到托管在 000webhost 中的外部数据库。
我正在使用此代码连接到我的数据库并创建一个帐户。
HttpClient http = new HttpClient();
string ss = "https://testdatabase.000webhost.com/database.php";
var formContent = new FormUrlEncodedContent(new[]{
new KeyValuePair<string,string>("Name", name.Text),
new KeyValuePair<string,string>("Email",email.Text),
new KeyValuePair<string,string>("Mobile",mobile.Text),
new KeyValuePair<string,string>("Password",pass.Text)
});
HttpResponseMessage response = await http.PostAsync(ss, formContent);
var responsedone = await response.Content.ReadAsStringAsync();
所以这就是我的问题所在......这是连接到我的数据库的安全方式吗?如果没有,我该怎么做或改变?
提前致谢!
【问题讨论】:
-
@stuartd 我想说的是,例如,如果用户登录。有人可以访问应用程序发送到服务器的数据吗?