asp.net中过滤掉非法字符的方法
2008-12-18 08:30 LvSir 阅读(1931) 评论(0) 收藏 举报 SqlCommand com = new SqlCommand("select count(*) from loginInfo where Name= @name and Pass=@ps", con);
com.Parameters.Add(new SqlParameter("@name", SqlDbType.VarChar, 50));
com.Parameters["@name"].Value = TextName.Text;
com.Parameters.Add(new SqlParameter("@ps", SqlDbType.VarChar, 50));
com.Parameters["@ps"].Value = FormsAuthentication.HashPasswordForStoringInConfigFile(TextPass.Text, "MD5");
SqlParameter表示SqlCommand的参数

为了实现梦想,无论遇到多么大的困难,都不退缩!