Public void onactionexecuting (actionexecutingcontext filtercontext)
{
String username = filtercontext. actionparameters ["username"]. tostring ();
If (! String. isnullorempty (username ))
{
Routedata RD = filtercontext. routedata; //. route. getroutedata (filtercontext. httpcontext );
VaR consult = consultservice. getconsultbyuser (username );
If (consult. isvip = 1 &&(! Rd. Values ["action"]. Equals ("vipblogindex ")))
{
// Var A = RD. route. GetType (). getfield ("Domain", bindingflags. instance | bindingflags. getfield | bindingflags. nonpublic | bindingflags. exactbinding );
// A. setvalue (RD. Route, username + ".cm.aqioo.com ");
Filtercontext. Result = new redirectresult ("http: //" + username + ".cm.aqioo.com/index.html ");
// New redirecttorouteresult ("vipblogindex", new routevaluedictionary (New {controller = "blog", Action = "vipblogindex", username = username }));
}
Else if (consult. isvip! = 1 &&(! Rd. Values ["action"]. Equals ("blogindex ")))
{
Filtercontext. Result = new redirectresult ("http://cm.aqioo.com/blog/" + username + ". html ");
// New redirecttorouteresult ("blogindex", new routevaluedictionary (New {controller = "blog", Action = "blogindex", username = username }));
}
}
}