.net网站同时注册到discuz php mysql5.0论坛?怎么做?

dotnet90 2008-03-26 02:59:59
注册.net网站同时注册到discuz php mysql5.0论坛?怎么做?怎么读取论坛用户的积分?
解决送100分
...全文
57 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
project15 2008-07-21
类似通行证的解决方案
回复
ten789 2008-07-20
开源的东西就一点好处

看看注册的源码用C#模仿一个不就OK了

就MYSQL来说 无关dz php还是.net 都是一样的查询语句

新的DZ数据结构不熟悉 不过看过源码后应该能理解 呵呵 论坛积分 DZ有算法 在表中储存的不一定准确
回复
dotnet90 2008-07-20
thanks
回复
justicesun 2008-07-20
同步注册,用同一个数据库

同步登陆,用cookie

积分直接读数据库啦

说实话,bbs推荐phpbb...DZ的代码太乱太复杂,看着眼晕~~
回复
chenou851123 2008-03-26
急是没有用的 还是要一步一步的分析 一个一个问题的解决 掉
才行的 研究下 先看数据库 在
实现同步注册 同步登陆 就好了
回复
dotnet90 2008-03-26
我急用discuz5.0 php mysql的呀,急呀!
回复
chenou851123 2008-03-26
我这个是 .net 同步注册到.net 的 discuz! 里面去 详细的细节还是要自己去研究 的 把用户数据库看几遍 用Visio 把表到如 就看的到关系了
研究把 呵呵
/// <summary>
/// 同步注册
/// </summary>
/// <param name="username">帐号</param>
/// <param name="gender">性别</param>
/// <param name="nickname">昵称</param>
/// <param name="password">密码(未加密)</param>
/// <param name="groupid">会员隶属组</param>
/// <param name="email">邮箱</param>
/// <param name="regip">注册IP</param>
/// <param name="qq">QQ号</param>
/// <param name="msn">MSN</param>
/// <returns>是否注册成功</returns>
public static bool Register(string username, int gender, string nickname, string password, int groupid, string email, string regip, string qq, string msn)
{
return IDC.Register(username, gender, nickname, password, groupid, email, regip, qq, msn);
}

-----------------------------
public bool Register(string username, int gender, string nickname, string password, int groupid, string email, string regip, string qq, string msn)
{
object[,] parsBBS = new object[2, 7] {
{ "@username","@gender","@nickname","@password","@groupid","@email","@lastip" },
{ username, gender, nickname, Motion.DZ.Command.Md5(password), groupid, email, regip } };
int LastId;

if (Motion.DZ.Command.DBC.vExecuteNonQuery(parsBBS,
String.Format("insert into [{0}users] (username,gender,nickname,password,groupid,email,regip) values (@username,@gender,@nickname,@password,@groupid,@email,@lastip)", Motion.DZ.Command.RC.Tableprefix), false, out LastId) <= 0)
{
return false;
}

object lid;
if (LastId <= 0)
{
lid = Motion.DZ.Command.DBC.vExecuteScalar(String.Format("select top 1 uid from [{0}users] order by uid desc", Motion.DZ.Command.RC.Tableprefix));
}
else
{
lid = LastId;
}

parsBBS = new object[2, 3] {
{ "@uid", "@qq", "@msn" },
{ lid, qq, msn } };
if (Motion.DZ.Command.DBC.vExecuteNonQuery(parsBBS, String.Format("insert into [{0}userfields] (uid, qq, msn) values (@uid, @qq, @msn)", Motion.DZ.Command.RC.Tableprefix), false) <= 0)
{
Motion.DZ.Command.DBC.vExecuteNonQuery(String.Format("delete from [{0}users] where uid={1}", Motion.DZ.Command.RC.Tableprefix, LastId));
return false;
}

parsBBS = new object[2, 2] { { "@username", "@userid" }, { username, lid } };
Motion.DZ.Command.DBC.vExecuteNonQuery(parsBBS, String.Format("update [{0}statistics] set totalusers=totalusers+1, lastusername=@username, lastuserid=@userid", Motion.DZ.Command.RC.Tableprefix), false);
return true;
}

-----------------------

同步登陆

public override bool Login(string username, string password, int expDays, bool inVisisble, string reFerer)
{
string Sql = String.Format("select top 1 tpp,ppp,pmsound,invisible,sigstatus,uid from [{1}users] where username='{0}'", username, Motion.DZ.Command.RC.Tableprefix);
System.Data.DataTable myDt = Motion.DZ.Command.DBC.vDataTable(Sql);
if (Object.Equals(myDt, null) || myDt.Rows.Count <= 0)
{
Motion.DZ.Command.Register(username, 0, String.Empty, password, 11, String.Empty);
myDt = Motion.DZ.Command.DBC.vDataTable(Sql);
}
GetUserInfo userinfo = new GetUserInfo(myDt);
if (Object.Equals(myDt, null) || myDt.Rows.Count <= 0) return false;

Motion.DZ.Command.DBC.vExecuteNonQuery(String.Format("UPDATE [{0}users] SET [lastvisit]=Now(), [lastip]='{2}' WHERE [username]='{1}'", Motion.DZ.Command.RC.Tableprefix, username, Motion.DZ.Command.RC.UserIP));

return Motion.DZ.Command.WriteLoginCookie(userinfo, inVisisble, reFerer, expDays, password);

}
回复
相关推荐
发帖
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
帖子事件
创建了帖子
2008-03-26 02:59
社区公告
暂无公告