最近我在学用flash和数据库连接,当我在写一个用户登陆验证的程序时,用flash里loadVariables方法通过在dreamever下写的 asp.net访问数据库时,flash里总是出现error opening url(),可我单独运行asp.net时,asp.net能与数据库建立连接,可能是flash与asp.net 没有建立连接,我把所有文件都保存在同一个文件夹里,flash 里的发布设置我也设了的”只访问网络”,到底是什么问题,这两天弄得我郁闷得很,望哪为高手能指点指点,小弟我感激不尽呀
我把代码写拷贝出来哈
flash端的代码:
stop();
btn.onRelease = function() {
if (lname == null || lpassword == null) {
_root.reply = "用户名和密码不能为空";
} else {
loadVariables("http://localhost/WebSite3/Default.aspx", _root, "GET");
_root.reply = "验证中";
}
};
_root.onData = function() {
if (login == "true") {
_root.reply = "验证成功";
} else if (login == "false") {
_root.reply = "用户名和密码不正确";
}
};
dreamever下的asp.net代码
string conString="server=localhost;database=success;uid=sa;pwd=13551116428";
SqlConnection mySqlCon=new SqlConnection(conString);
SqlCommand mySqlCom=mySqlCon.CreateCommand();
mySqlCom.CommandText="SELECT * FROM yanzheng WHERE name='"+Request.Form["lname"]+"' AND password='"+Request.Form["lpassword"]+"'";
mySqlCon.Open();
SqlDataReader myReader=mySqlCom.ExecuteReader();
if(myReader.Read())
{
Response.Write("login=true");
}
else
{
Response.Write("login=false");
}
myReader.Close();
mySqlCon.Close();
还望大家多多指教哈
谢谢呵
This blogger is recording some code samples,technical skill of java,.Net,javascript, css, html for myself use. All articles are coming from my own experience and my collections which are from internet world. If you find any material have copy right issue please leave a comment to me. I will delete it immediately. These articles are writing in English or Chinese. Hope these information can help other technical guys. Thanks for reading.
Subscribe to:
Post Comments (Atom)
-
If you get "This page calls for XML namespace http://richfaces.org/a4j declared with prefix a4j but no taglibrary exists for that names...
-
Method 1: import oracle.sql.*; public class JClob { String tableName = null; // String primaryKey = null; // String primaryValue = null; // ...
-
1.HTTP-binding(ServiceMix) 1.4 各组件间传递消息流的过程如下: 1. HttpClient : Http 客户端运行一个独立的 Java 客户端程序,通过其中的 URLConnection 类连接到 http://...
No comments:
Post a Comment