时间:2021-07-01 10:21:17 帮助过:20人阅读
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);
}
}
}