写类文件时候不只是个把地方要用到某些方法,就不想引入命名空间了。哎,搞不清楚,记录下吧。用到个记录个。
注意以下要添加项目引用 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
Server.MapPath
ConfigurationSettings.AppSettings["AC_DbPath"]);
Session
MD5
ConfigurationSettings
ServerVariables (热,找了我半天才找到。 )
Response.Write(ServerVariables["HTTP_REFERER"]);
HtmlEncode
PagedDataSource
Regex正则表达式
Request.CurrentExecutionFilePath 获取当前请求的虚拟路径
StreamReader sr = File.OpenText(
System.Web.HttpContext.Current.Server.MapPath("Resource/Templet"));