堕落的卖猪贩-做人就象做诗,一旦上了境界,就下不来了。

我的Ber客我作主,今天你Ber没有。

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

写类文件时候不只是个把地方要用到某些方法,就不想引入命名空间了。哎,搞不清楚,记录下吧。用到个记录个。

注意以下要添加项目引用 System.Web.dll

使用using System.Configuration;这些需要using System.Configuration;命名空间

  public void Break(string StrInfo)
  {  
   System.Web.HttpContext.Current.Response.Write("<script>alert(\'"+ StrInfo +"\');history.back();</script>");
   System.Web.HttpContext.Current.Response.End();
  }

userjudge2=System.Text.Encoding.Default.GetByteCount(str);

StringBuilder sb=new StringBuilder();

sb.Append("×××)");


 

Response

System.Web.HttpContext.Current.Response.Write ("<script>alert(\'" + ErrInfo + "\');history.back();<" + "/script>"); 

 

Server.MapPath 

System.Web.HttpContext.Current.Server.MapPath( 
   ConfigurationSettings.AppSettings[
"AC_DbPath"]); 


Session

System.Web.HttpContext.Current.Session["AdmCheckCode"]  

MD5

System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str,"MD5"

ConfigurationSettings

System.Configuration.ConfigurationSettings.AppSettings["MailFrom"]; 

ServerVariables (热,找了我半天才找到。 )

System.Collections.Specialized.NameValueCollection  ServerVariables = System.Web.HttpContext.Current.Request.ServerVariables; 
   Response.Write(ServerVariables[
"HTTP_REFERER"]); 

HtmlEncode

System.Web.HttpUtility.HtmlEncode(msg)

 PagedDataSource

private System.Web.UI.WebControls.PagedDataSource _objpds;

 Regex正则表达式

System.Text.RegularExpressions Regex

 

 

Request.CurrentExecutionFilePath 获取当前请求的虚拟路径
StreamReader sr = File.OpenText(
    System.Web.HttpContext.Current.Server.MapPath("Resource/Templet"));

posted on 2005-12-07 21:49  堕落的卖猪贩  阅读(931)  评论(1编辑  收藏  举报