zoukankan      html  css  js  c++  java
  • 2007年3月小记

    1、使用System.Web.Hosting.HostingEnvironment.MapPath方法也可以获取"~/path/*.*"文件的绝对路径。
    2、在IIS7使用ASP.NET AJAX时,网站的应用程序池必须设置为集成模式(integrated)
    3、SQL数据库远程链接。

        --远程链接获取信息
        EXEC sp_addlinkedserver 
            
    @server='ls_instance',--别名
            @provider='SQLOLEDB',
            
    @srvproduct='',
            
    @datasrc='www.cnblogs.com'--远程服务器名

        
    EXEC sp_addlinkedsrvlogin 
            
    @rmtsrvname='ls_instance',
            
    @useself='false',
            
    @locallogin='sa',
            
    @rmtuser='sa',
            
    @rmtpassword='123456'


        
    EXEC sp_droplinkedsrvlogin 'ls_instance''sa'
        
    --EXEC sp_linkedservers
        EXEC sp_dropserver 'ls_instance'

    4、如何在VS2005 SP1中打开HTML编辑器中的元素的属性显示?
          工具-->选项-->文本编辑器-->HTML-->杂项-->选择“在源视图中启用属性网格”
     
    5、导出某列表控件到一个Excel表格

        public void ToExcel(System.Web.UI.Control ctl)
        
    {
            Response.Clear();
            Response.AppendHeader(
    "Content-Disposition""attachment;filename=Excel.xls");
            Response.Charset 
    = "GB2312";
            Response.ContentEncoding 
    = System.Text.Encoding.GetEncoding("GB2312");
            Response.ContentType 
    = "application/ms-excel";
            ctl.Page.EnableViewState 
    = false;
            System.IO.StringWriter tw 
    = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter hw 
    = new System.Web.UI.HtmlTextWriter(tw);
            ctl.RenderControl(hw);
            HttpContext.Current.Response.Write(tw.ToString());
            HttpContext.Current.Response.End();
        }

    6、简单判断是否为IE。 if(!document.uniqueID) window.location = window.location;

    7、在ASP.NET AJAX中如何判断浏览器及计算其宽高。
                function getClientBounds()
                
    {
                    
    var clientWidth;
                    
    var clientHeight;
                    
    switch(Sys.Browser.agent) {
                        
    case Sys.Browser.InternetExplorer:
                            clientWidth 
    = document.documentElement.clientWidth;
                            clientHeight 
    = document.documentElement.clientHeight;
                            
    break;
                        
    case Sys.Browser.Safari:
                            clientWidth 
    = window.innerWidth;
                            clientHeight 
    = window.innerHeight;
                            
    break;
                        
    case Sys.Browser.Opera:
                            clientWidth 
    = Math.min(window.innerWidth, document.body.clientWidth);
                            clientHeight 
    = Math.min(window.innerHeight, document.body.clientHeight);
                            
    break;
                        
    default:  // Sys.Browser.Firefox, etc.
                            clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
                            clientHeight 
    = Math.min(window.innerHeight, document.documentElement.clientHeight);
                            
    break;
                    }


                    
    return new Sys.UI.Bounds(00, clientWidth, clientHeight);
                }

    8、Vista侧边栏安装与配置
    9、Passport学习:
    Passport 身份验证 
    在ASP.NET应用程序中集成Passport验证

  • 相关阅读:
    linux dns子域授权 split分离解析 缓存dns服务器
    linux kvm虚拟机快速构建及磁盘类型
    linux虚拟化概述
    一个http请求从用户输入网址开始到结束都发生了什么
    Django lazy load 懒加载 倒序查询
    fun = [lambda x: x*i for i in range(4)] 本质解析/原理,LEGB规则 闭包原理
    linux 下mysql服务的管理
    MySQL 增删改查
    redis的应用场景 为什么用redis
    redis中的hash、列表、集合操作
  • 原文地址:https://www.cnblogs.com/chenjunbiao/p/1760241.html
Copyright © 2011-2022 走看看