由于服务器托管,我正在尝试使用php将C#应用程序连接到sql服务器。
我尝试使用Web客户端类
private void BtnLogin_Click(object sender, EventArgs e)
{
string Userinput = new WebClient().DownloadString("http://zrm.unaux.com/Login.php?Username=" + txtUsername.Text + "&Password=" + txtPass.Text);
switch (Userinput.ToLower())
{
case "1":
{
MessageBox.Show("1");
break;
}
case "2":
{
MessageBox.Show("2");
break;
}
case "3":
{
MessageBox.Show("3");
break;
}
default :
{
MessageBox.Show("Not Connected");
break;
}
}
<html>
<body>
<script type=\"text/javascript\" src=\"/aes.js\" ></script>
<script>
function toNumbers(d) {
var e = [];
d.replace(/(..)/g, function(d) {
e.push(parseInt(d, 16))
});
return e
}
function toHex() {
for (var d = [], d = 1 == arguments.length && arguments[0].constructor == Array ? arguments[0] : arguments, e = \"\",f=0;f<d.length;f++)e+=(16>d[f]?\"0\":\"\")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers(\"f655ba9d09a112d4968c63579db590b4\"),b=toNumbers(\"98344c2eee86c3994890592585b49f80\"),c=toNumbers(\"8fdda47311600c481f5f2fe34d2c79e3\");document.cookie=\"__test=\"+toHex(slowAES.decrypt(c,2,a,b))+\"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/\"; location.href=\"http://zrm.unaux.com/Login.php?Username=zeph&Password=123&i=1\
</script>
<noscript>
This site requires Javascript to work, please enable Javascript in your
browser or use a browser with Javascript support
</noscript>
</body>
</html>