discuz! NT and ASP.net integrated example tutorial

Source: Internet
Author: User

  Because the project needs a forum, there would have been CS, in. NET under the well-known foreign Open source forum. But in order to adapt to the domestic atmosphere, the final selection in the domestic heyday of the discuz! Nt. Discuz and ASP.net development of the site integration, a lot of people have been completed. However, no more detailed descriptions were found on the web. There are many kinds of methods.

When registering a new user in a project, the user of the Forum is also called to register, so that it is registered synchronously. As for the deletion of the user, it seems discuz! NT does not provide API, can delete the user in the project, then directly to delete discuz! The dependencies in the NT user table. Here, I will write out this experience, I hope to be useful to you. After reading this article http://anforen.5d6d.com/thread-855-1-1.html and this article http://wiki.nt.discuz.net/index.php?title=%E5%A6%82%E4% Bd%95%e4%bd%bf%e7%94%a8%e6%b5%8b%e8%af%95%e6%8e%a7%e5%88%b6%e5%8f%b0 I had an epiphany ... As described in the article above, press Discuz!nt's user's Guide to install the Forum under Windows 2003. and to admin in, add apikey and so on. Then use VS2008 to create a new project, adding Toolkit.dll and JSON references. Well, if you read the above article carefully, plus, I put a little bit of code here, should be able to complete. The code (implementing login and Registration) 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 = "c83a253f082bc671d8fbe42d485a148 8 "; 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); }}  

http://four-corner.appspot.com/

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.