惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - 阿昆

[分享]真正的分页存储过程,借鉴了CSDN上众多力量,除BUG版,分享给大家 CommunityServer页面间关系 CommunityServer皮肤主题的更换 CommunityServer实例分析 CommunityServer布局 - 阿昆 - 博客园 Community Server系列之七:快速找到需要修改的文件[技巧] Community Server系列之六:CS2中的关键词及数据结构 Community Server系列之八:CS2中的CSContext Community Server系列之四:Ajax在CS2.0中的应用1 Community Server配置对网址中的www信息处理功能分析 Community Server架构:博客业务详细分析 如何在 Microsoft Visual Studio 2005 中直接Debug Community Server 2.0 的代码 与 Visual Studio 2005 Web Application Projects Community Server2.0专注细节一 邮件提醒按钮实现(上) Community Server专题附录一: 什么是Threads & Processes Community Server专题九:MemberRole之Profile Community Server专题八:MemberRole之Membership深入篇 Community Server专题八:MemberRole之Membership Community Server专题七: Job & Timer Community Server专题六:Delegates & Events - 阿昆
CommunityServer研习心得
阿昆 · 2006-06-02 · via 博客园 - 阿昆
 

整个anf的结构其实都遵循同样的编程模型
都是
请求url->url rewrite->aspx->ascx->load cs->response
把握好一个页面的写作方式,其他就不攻自破了

eg.
aspnetforums/showforum.aspx
controls/view/threadview.cs
AspNetForums.Controls.ForumImageButton
直接用类判断是否有权限
visable控制显示
   // User permissions on new post button
   //
审核用户的发贴权限!!!!!终于找到了!!!
   ForumPermission p = forum.Permission;
   User user = Users.GetUser();
   if (p.Post == AccessControlEntry.Deny)
   {
    ForumImageButton newPostButton = (ForumImageButton) skin.FindControl("NewPostButton");
    if (newPostButton != null)
    {
     newPostButton.Visible = false;  //
直接用visible=false来控制!!
    }
   }   
     //判断论坛逻辑上是否允许发贴
                    try {
                        ForumPermission.AccessCheck(forum, Permission.Post, post);
                    } catch (ForumException) {
                        return;
                    }
显示不同ui和是否有执行某项功能的权限由两个类决定
AspNetForums.ForumPermissions
public static ForumPermission GetForumPermission (int forumID, int roleID)
public static ArrayList GetForumPermissions (int forumID)

AspNetForums.Components.User
AspNetForums.Components.UserCookie
来存储权限信息

页面之间权限的持续化由ForumContext类实现
本质是通过HttpContext存储

好像是生成了一个自定义Vcard对象的序列化字段在b/s间通讯
继续研究!!!

anf,Http Module主要用于url rewrite,权限验证,页面预处理等等
  <!-- START - AspNetForums specific application settings -->
  <httpModules>
   <add name="AspNetForums" type="AspNetForums.ForumsHttpModule, AspNetForums.Components" />
  </httpModules>

  <httpHandlers>
   <add verb="GET" path="avatar.aspx" type="AspNetForums.Components.HttpHandler.AvatarHttpHandler, AspNetForums.Components" />
   <add verb="GET" path="vcard.aspx" type="AspNetForums.Components.HttpHandler.VCardHttpHandler, AspNetForums.Components" />
  </httpHandlers>

http handler主要实现不需要返回页面的处理的实现
因为http handler会截获request而不转入实际aspx页面处理


Forums
用的是.Netform验证,你只要用Page.Request.IsAuthenticated就可以判断是否登陆!

保存用户信息的几种方法
Cookie

Response.Cookies.Add(new HttpCookie("currPage","1"));
currPage=Int32.Parse(Request.Cookies["currPage"].Value);
Session

Session["currPage"]=1;
currPage=(int)Session["currPage"];
ViewState

this.ViewState["currPage"]=1;
currPage=Int32.Parse(this.ViewState["currPage"]);
QuringString

Movie.aspx?currPage=1;
currPage=Int32.Parse(Request.QueryString["currPage"]);
Attributes

txtPage.Attributes.Add("currPage",1);
currPage=Int32.Parse(txtPage.Attributes["currPage"]);


所有通过 ASP.NET 引擎传递的请求最终都将到达 HTTP 处理程序或 HTTP 处理程序工厂(HTTP 处理程序工厂仅返回 HTTP 处理程序的实例,然后使用该实例来处理请求)。最终的 HTTP 处理程序将返回响应,即呈现被请求的资源。此响应将被发送回 IIS,然后 IIS 将响应返回给提出请求的用户。

ASP.NET 包括许多内置的 HTTP 处理程序。例如,PageHandlerFactory 用于呈现 ASP.NET 网页。WebServiceHandlerFactory 用于呈现 ASP.NET Web 服务的响应 SOAP 信封。TraceHandler 将向 trace.axd 呈现请求的 HTML 标记。