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验证

  • 相关阅读:
    只要三步,使用html5+js实现像素风头像生成器
    按Ctrl+Enter发送的实现
    “放到桌面”的Servlet实现
    从tom大叔那想着拿书的,呵呵。
    也写dateUtil.js
    智习室
    零基础爬虫课,不会编程也能做爬虫
    1小时教你学会如何采集微博数据:0基础小白也能轻松学会!
    TransactionScope 分布式事务配置
    centos7创建共享文件夹
  • 原文地址:https://www.cnblogs.com/chenjunbiao/p/1760241.html
Copyright © 2011-2022 走看看