本文只为说明如何创建自己的aspx文件,真正写插件没这么简单,
希望对会用.net但没时间研究discuz!nt或和我一样第一次用
WebDeployment Projec的朋友有所帮助.
因为今天不能发附件了,明天去软交会可能不上网,所以凑合发了,就不放图了.
看此文前,可以看看
http://nt.discuz.net/showtopic-19559.html正文开始:
1.在aspx文件夹下建个helloword.aspx,vs会自己创建helloword.aspx.cs.
(其实可以建在任意位置,我认为建在这里比较合适)
2.对helloword.aspx.cs进行修改.可以参考下面,
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Discuz.Forum;
namespace Discuz.ForumPage
{
public partial class helloword : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string showhellword;
protected override void ShowPage()
{
showhellword = "Hello Word!";
}
}
}
3.修改helloword.aspx中的第一句为
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="helloword.aspx.cs" Inherits="Discuz.ForumPage.helloword" %>
4.在templates\default下创建helloword.htm.
内容可以是
{showhellword}
5.生成,打开浏览器,到后台生成这个模板.
6.把Discuz.ForumPage生成文件的位置(我的是\CehuarenCode\Discuz.ForumPage\Debug)下的aspx\helloword.aspx考回\Source Code\aspx\1目录下一份.
7.这个狗P插件已经做好了.可以通过浏览器浏览了.
以上只是个人做法,也不知道有没有更好方法,希望不要误导各位.