Asp.net and discuz! NT integrated integration instance tutorial
Source: Internet
Author: User
However, no detailed description is found on the Internet. There are many methods.
Here, I will write this experience and hope it will be useful to you.
Read this article Article
Http://www.jb51.net/article/20851.htm
And this article
Http://www.jb51.net/article/20850.htm
As described in the above article, first press discuz! NT user guide. Install the Forum in Windows 2003.
Add apikey and so on as admin.
Use vs2008 to create a project and add reference of toolkit. dll and JSON.
Well, if you have read the above article carefully, I will post some more here. Code .
When registering a new user in the project, the user registration of the Forum is also called, so that the registration is synchronized. As for deleting a user, it seems that discuz! NT does not provide APIs. You can delete the discuz directly when deleting a user in the project! Related items in the User table of NT.
The Code (implementing logon and registration) is as follows:
Copy code The Code is as follows: 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 = "bdb7performancef77149adec776b1b6e92ee8 ";
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 );
}
}
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service