色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

asp.net與Discuz!NT整合集成實例教程

但在網上沒有找到較詳細的描述。方法倒是有很多種。
在此,我就將此次經歷寫出來,希望對您有用。
在看過這篇文章
http://www.jb51.NET/article/20851.htm
和這篇文章
http://www.jb51.NET/article/20850.htm
按上述文章的描述,先按discuz!nt的用戶指南,在windows 2003下安裝好論壇。
并以admin進去,添加apikey等。
然后用VS2008新建一項目,添加toolkit.dll和json的引用。
好了, 如果你認真看過上述文章,再加上,我這兒貼的一點代碼,應該可以完成了。
在項目中注冊新用戶時,也同時調用論壇的用戶注冊,這樣就同步注冊了。至于刪除用戶,似乎Discuz!NT沒有提供API,可以在項目中刪除用戶時,再直接去刪除Discuz!NT的user表中的相關項。
代碼(實現了登錄和注冊)如下:
復制代碼 代碼如下:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Discuz.Toolkit;
namespace IntDNT3
{
public partial class _Default : System.Web.UI.Page
{
string api_key = "c83a253f082bc671d8fbe42d485a1488";
string secret = "bdb7378cef77149adec776b1b6e92ee8";
string url = "http://localhost/";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnValidation_Click(object sender, EventArgs e)
{
DiscuzSession ds = new DiscuzSession(api_key, secret, url);
Uri uri = ds.CreateToken();
Response.Redirect(uri.ToString());
}
protected void btnLogin_Click(object sender, EventArgs e)
{
DiscuzSession ds = new DiscuzSession(api_key, secret, url);
int uid = ds.GetUserID(tbUserName.Text);
ds.Login(uid, tbPWD.Text, false, 10, "");
}
protected void btnRegister_Click(object sender, EventArgs e)
{
DiscuzSession ds = new DiscuzSession(api_key, secret, url);
ds.Register("testa", "123123", "dafafa@51ASPx.com", false);
}
}
}

AspNet技術asp.net與Discuz!NT整合集成實例教程,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 来凤县| 东城区| 呼图壁县| 卢龙县| 京山县| 阳曲县| 象山县| 吐鲁番市| 横山县| 康定县| 灵寿县| 尼勒克县| 荆州市| 布拖县| 南乐县| 顺平县| 广汉市| 旌德县| 红河县| 冀州市| 遂川县| 金沙县| 清镇市| 永清县| 武城县| 枞阳县| 柘荣县| 嘉兴市| 磴口县| 保定市| 澎湖县| 河源市| 视频| 牟定县| 富蕴县| 太保市| 金山区| 洞口县| 工布江达县| 梁平县| 柳林县|