using System;
using System.Data;
using System.Data.SqlClient;
namespace BBS
{
public class BBSServer
{
private string m_strCon;
private SqlConnection m_Con;
//the property of connection string
public string ConnectString
{
get
{
return m_strCon;
}
set
{
m_strCon = value;
}
}
//connect 2 database
public void Connect2DB()
{
m_Con = new SqlConnection(m_strCon);
m_Con.Open();
}
//Log Into the BBS
public bool Login(string USER,string PSD)
{
USER.TrimEnd();
PSD.TrimEnd();
string strSqlLogIn = "Select Count(*) as uCount from webuser where name ='" + USER + "' and psd ='" + PSD + "'";
SqlCommand cmdLogIn = new SqlCommand(strSqlLogIn,m_Con);
int count =(int) cmdLogIn.ExecuteScalar();
if (count == 0)
return false;
else
return true;
}
}
}