1
string
sql;
2![None.gif](/Images/OutliningIndicators/None.gif)
3
sql
=
string
.Format(
"
SELECT COUNT(ID) FROM OUSER WHERE UserName='{0}' and Password='{1}';
"
,
4
this
.txtUserName.text,
5
this
.txtPassword.text);
6![None.gif](/Images/OutliningIndicators/None.gif)
7
//
.
这是可以防止SQL注入式攻击的一种方式。
![None.gif](/Images/OutliningIndicators/None.gif)
2
![None.gif](/Images/OutliningIndicators/None.gif)
3
![None.gif](/Images/OutliningIndicators/None.gif)
4
![None.gif](/Images/OutliningIndicators/None.gif)
5
![None.gif](/Images/OutliningIndicators/None.gif)
6
![None.gif](/Images/OutliningIndicators/None.gif)
7
![None.gif](/Images/OutliningIndicators/None.gif)
![dot.gif](/Images/dot.gif)