zoukankan      html  css  js  c++  java
  • 常用命名空间位置

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

    注意以下要添加项目引用 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"));

  • 相关阅读:
    printf语句中%p ,%#x区别
    Ant执行一个含有main方法的class文件
    aix 扩展文件系统
    ORA-01653:表空间扩展失败的问题(开启表空间自动扩展)
    oracle创建表空间语句分解
    Oracle10g/11g 在SUSE/RHEL上的安装与配置
    15个实用的Linux find命令示例
    suse安装软件命令
    如何把.rar文件隐藏在一个图片内
    windows 7 中将“我的电脑”锁定到任务栏
  • 原文地址:https://www.cnblogs.com/zkxp/p/292721.html
Copyright © 2011-2022 走看看