博客 (159)

下载最新版 Visual Studio 请点击这里:http://xoyozo.net/Software/Visual_Studio

 

前日(2010年4月12日),微软正式发布了 Microsoft Visual Studio 2010,相信这是个让众多微软开发者们心情激动的一天吧。至于 VS是啥米东东之类的就不再解释了,相关人员请移步维基百科

 

微软称 Visual Studio 2010 集成开发环境(IDE)的界面被重新设计和组织,变得更加清晰和简单。新的 IDE 更好的支持了多文档窗口以及浮动工具窗,并且对于多显示器的支持也有所增强。IDE的外壳使用 WPF 重写,内部使用 MEF 重新设计,以提供比先前版本更好的扩展性。

版本说明

VS2010 的版本较之前版本有所不同,取消了标准版、团队版命名方式等,而采用跟 Window 7 一致的:

产品功能 Professional (专业版) Premium (高级版) Ultimate (旗舰版)
测试和诊断
测试工具
集成开发环境
数据库开发
开发平台支持
体系结构和建模 ×
Lab Management × ×
Team Foundation Server
MSDN 订阅
价格 $1,199 $5,469 $11,899

(注:√ 支持 × 不支持 ≈ 部分支持)

旗舰版下载地址(官方简体中文版)

“只选贵的”符合天朝国情。许多大侠认为官方下载的肯定是未破解的,那是您的错,其实微软也是一只河蟹,记住一个公式:Trial(测试版)+ Key(序列号)= 正式版

分卷下载:(下载后双击part1.exe解压为 VS2010UltimTrial.iso)
VS2010UltimTrialCHS_4PartsTotal.part1.exe 官网下载 迅雷下载
VS2010UltimTrialCHS_4PartsTotal.part2.rar 官网下载 迅雷下载
VS2010UltimTrialCHS_4PartsTotal.part3.rar 官网下载 迅雷下载
VS2010UltimTrialCHS_4PartsTotal.part4.rar 官网下载 迅雷下载
完整镜像下载: X16-60997VS2010UltimTrialCHS.iso 官网下载 迅雷下载
CRC: 0x3DB619A0
SHA-1: 0x8BA7308E1F74AEE8DE6094CE04F78CD21486608D

旗舰版下载地址(官方英文版)

分卷下载:(下载后双击part1.exe解压为 VS2010UltimTrial.iso)
VS2010UltimTrial_4PartsTotal.part1.exe 官网下载 迅雷下载
VS2010UltimTrial_4PartsTotal.part2.rar 官网下载 迅雷下载
VS2010UltimTrial_4PartsTotal.part3.rar 官网下载 迅雷下载
VS2010UltimTrial_4PartsTotal.part4.rar 官网下载 迅雷下载
完整镜像下载: X16-42552VS2010UltimTrial1.iso 官网下载 迅雷下载
CRC: 0x8095c67f
SHA-1: 0x8371f6a8d090063fcc320617e94854374633df3c

关心的话题

钥匙:YCFHQ-9DWCY-DKV88-T2TMH-G7BHP(需刮开才能看到,显示器刮坏请找经销商)

39,729
Enumerable.First 方法

返回序列中的第一个元素。

Enumerable.FirstOrDefault 方法

返回序列中的第一个元素;如果序列中不包含任何元素,则返回默认值。

Enumerable.Single 方法

返回序列的唯一元素;如果该序列并非恰好包含一个元素,则会引发异常。

Enumerable.SingleOrDefault 方法

返回序列中满足指定条件的唯一元素;如果这类元素不存在,则返回默认值;如果有多个元素满足该条件,此方法将引发异常。

xoyozo 16 年前
5,826
网页可见区域宽:document.documentElement.clientWidth  
网页可见区域高:document.documentElement.clientHeight  
网页可见区域宽:document.documentElement.offsetWidth (包括边线的宽)  
网页可见区域高:document.documentElement.offsetHeight (包括边线的宽)  
网页正文全文宽:document.documentElement.scrollWidth  
网页正文全文高:document.documentElement.scrollHeight  
网页被卷去的高:document.documentElement.scrollTop  
网页被卷去的左:document.documentElement.scrollLeft  
网页正文部分上:window.screenTop  
网页正文部分左:window.screenLeft  
屏幕分辨率的高:window.screen.height  
屏幕分辨率的宽:window.screen.width  
屏幕可用工作区高度:window.screen.availHeight  
屏幕可用工作区宽度:window.screen.availWidth
5,058

PNG半透明背景图片效果
PNG图片在网页设计中扮演着一个很重要的角色,利用PNG图片的特点可以制作出实用,绚丽的效果,可是对于PNG图片的支持却不是很理想,Firefox和Opera对PNG支持的比较好,特别是Firefox浏览器。可是IE却不理PNG,使得设计者无法很随意的使用png图片。

IE5.5+的AlphaImageLoader滤镜为通向png提供了一个道路,如果他载入的是PNG(Portable Network Graphics)格式,则0%-100%的透明度也被提供。我们就利用这个滤镜和hack来设计一个半透明png背景图片的模型

这里是个超链接测试

(X)HTML: <div id="wrap">
<p><a href="http://www.jluvip.com"><strong>PNG半透明背景图片效果</strong></a><br />:PNG图片在网页设计中扮演着一个很重要的角色,利用PNG图片的特点可以制作出需要使用绚丽的效果,可是对于PNG图片的支持却不是很理想,Firefox和Opera对PNG支持的比较好,特别是Firefox浏览器。可是IE却不理PNG,是的设计者无法很随意的使用png图片。</p>
<p>IE5.5+的AlphaImageLoader滤镜为通向png提供了一个道路,如果他载入的是PNG(Portable Network Graphics)格式,则0%-100%的透明度也被提供。我们就利用这个滤镜和hack来设计一个半透明png背景图片的模型
</p>
<p><a class="test" href="http://www.jluvip.com">这里是个超链接测试</a></p>
CSS: #wrap{ width:460px;margin:20px auto 20px 80px;text-align:left;height:300px; padding:20px; border:1px #eee solid;}
/*not for ie 6.0*/
html>body #wrap{background: url(img/bgcanvas.png) repeat;}
/*for ie 6.0*/
* html #wrap {
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="img/bgcanvas.png");
background:none;
}
#wrap a{color:#c00; text-decoration: none; position:relative;}/*解决IE下链接失效的问题*/
#wrap a:hover{ text-decoration:underline;}

nbsp;

观看效果

3,879
代码
<INPUT onfocus="oRng=this.createTextRange();oRng.collapse(true);oRng.moveStart('character',3);oRng.select()" value=abcdefg type=text name=text1>
效果

当焦点移至文本框时光标定位在位置3。

补充

如果要直接定位在文本末尾,把上面的数字 3 改为 this.value.length 即可。

xoyozo 17 年前
5,234

代码:

<input type="text" name="re_name" style="width: 100px; height: 21px; font-size: 10pt;" /><span
style="width: 18px; border: 0px solid red;">
<select name="r00" style="margin-left: -101px; width: 118px; background-color: #FFEEEE;"
onchange="document.all.re_name.value=this.value;">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</span>

 

说明:

该代码兼容性非常差,在XHTML文档中或在非IE浏览下浏览均不能达到预期效果,原因可能是它们的 select 元素的 z-index 太高,并且 css 定位方式不同,部署于应用还需改进代码。

xoyozo 17 年前
5,902

方法:
   alert,对话框,OK按钮
   confirm,对话框,OK和Cancel按钮
   prompt,对话框,可输入
   close,关闭当前浏览器窗口
   navigate,在当前窗口中导航到指定的URL资源
   setInterval,设置每隔一定时间调用指定程序代码,毫秒,setInterval("Func()",5000)
   setTimeout,设置经过一定时间后执行一次指定程序代码,毫秒,setTimeout("Func()",5000)
   clearInterval,
   clearTimeout,
   moveTo,将浏览器窗口移动到屏幕上的某个位置
   resizeTo,改变浏览器窗口的大小
   open,打开一个新窗口 window.open("abc.html","_blank","top=0,left=0,width=100,height=200,toolbar=no");
   showModalDialog产生一个模态对话框
   showModelessDialog产生一个非模态对话框窗口
属性:
    closed
    opener
    defaultstatus
    status
    screenTop
    screenLeft
事件:
    onload,onunload,onmouseover,...
对象属性:
    location对象:设置和返回当前网页的URL信息。
        载入一个新的网页:window.location.href="http://g.cn";
        刷新当前页:window.location.reload();
    event对象:获取和设置当前事件的有关信息。
        altKey属性,用于检测事件发生时Alt键是否被按下
        ctrlKey。。。
        shiftKey...
        screenX,screenY设置和返回鼠标相对屏幕顶点的x,y坐标
        offsetX,offsetY设置和返回鼠标相对事件源顶点的x,y坐标
        x,y 设置和返回鼠标相对事件源的父元素顶点x,y坐标
        returnValue设置和返回事件的返回值,一般情况下设置为false
        cancelBubble设置和返回当前事件是否继续向下传递
        srcElement设置和返回事件源对象
        keyCode设置和返回键盘按下或弹起时的键的unicode码
        button检索鼠标动作使用的是哪个按键,1左鍵,2右键,3左右同时
function window_onkeypress()
{
//    alert(window.event.keyCode);
    if(window.event.keyCode==27)
    {
        window.close();
    }
}

xoyozo 17 年前
5,561


--------------------
常量:
整型,实型,布尔值,字符串型,null,undefined

变量:var
--------------------
除法运算:9/4 = 2.25 (而不是2)

--------------------
系统函数:
1,encodeURI URL编码
   var urlStr=encodeURI("http://www.abc.com/?country=吴&name=z x");
   结果:http://www.abc.com/?country=%E5%90%B4&name=z%20x
2,decodeURI URL解码
3,parseInt 将字符串按指定进制转换成一个整数,参数二表示进制
   parseInt("32",10) 结果:32
   parseInt("3c2",10) 结果:3
   parseInt("c32",10) 结果:NaN
   parseInt("0x18",10) 结果:0
   parseInt("12",16) 结果18
4,parseFloat 将字符串转成小数
   parseFloat("2.5") 结果:2.5
   parseFloat("2.c5") 结果:2
   parseFloat("c2.5") 结果:NaN
5,isNaN 用于检测parseInt和parseFloat返回是否为NaN
   返回true/false
6,escape 编码
   非ASCII替换为%xx
7,unescape 解码
8,eval 将字符串作为JS表达式执行,例
   for(var i=0;i<3;i++) eval("var a"+i+"="+i);
   相当于:
   var a0=0; var a1=1; var a2=2;
--------------------
对象
1,Object
2,String
   方法:
   indexOf,
   lastIndexOf,
   match,使用正则表达式模式对字符串执行搜索,返回包含该搜索结果的数组
   replace,
   search,使用正则表达式搜索,第一个匹配的字符的位置
   slice,截字符串:参数一,开始位置,参数二,结束位置(不指定或为-1时表示末位置)
   split,返回一个字符串按照某种分隔标志符拆分为若干子字符串时所产生的字符串数组,分隔符可以是多个字符或一个正则表达式,它不作为任何数组元素的一部分返回。
   substr,截字符串:参数一,开始位置,参数二,长度
   toLowerCase,
   toUpperCase,
3,Math(不能用new创建)
   方法:
   abs,绝对值
   sin,cos,正余弦
   asin,acos,反正余弦
   random,返回介于0~1之间的伪随机数
   例:var num = Math.randow();
4,Date
    var currentTime=new Date();
    //var currentTime=new Date(2002,3,4);
    var strDate=currentTime.getYear()+"年";
    strDate+=currentTime.getMonth()+"月";
    strDate+=currentTime.getDate()+"日";
    strDate+=currentTime.getHours()+":";
    strDate+=currentTime.getMinutes()+":";
    strDate+=currentTime.getSeconds()+" ";
    strDate+=currentTime.getMilliseconds();
    alert(strDate);
   结果:2008年1月19日15:27:10 518
----------------------
数组
1,
    var arr=["abc",123,'abc',,3.4];
    for(var i=0;i<arr.length;i++)
    {
        alert(arr[i]);
    }
2,用对象的方式实现数组
    function MyArray(){this.length=arguments.length;for(var i=0;....
3,Array对象
    var arr=new Array(2.4,"abc",2);
    arr.sort(); //排序
    alert的结果为 2 2,4 abc
-----------------------

xoyozo 17 年前
5,238

p:first-line   段落中的第一行文本

p:first-lette   段落中的第一个字母

<STYLE type=text/css>
p.view{color:green; font-size:12px}
p.view:first-line{color:yellow; font-size:12px}
p.view:first-letter{color:red; font-size:24px}
</STYLE>

<P class=view>中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国</P>
<P class=view>abcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefg</P>

 

效果:

 

中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国中华人民共和国

abcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefg

 

xoyozo 17 年前
4,360
现在浏览器一般都支持gzip,deflate压缩协议 , 也就是说当服务器返回的是用gzip或deflate协议进行压缩过的内容, 浏览器将自动的进行解压缩 .这样做可以节省大量的网络带宽,负面影响是加重了服务器的负担.

我们只是对aspx页面进行压缩 ,当然也可以压缩js和css . 但你也想用来对图片也进行压缩的话就错了 ,效果和用winzip压缩图片一样, 只能增大体积.

首先来看看一个实例 aspx页面压缩前和压缩后的页面信息
压缩前

压缩后

可以看到压缩到原来页面大小的27% 效果还是可以的.
看看具体代码
CompressionModule

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->#region Using

using System;
using System.Web;
using System.IO.Compression;

#endregion

namespace BlogEngine.Core.Web.HttpModules
{
  /// <summary>
  /// Compresses the output using standard gzip/deflate.
  /// </summary>
  public class CompressionModule : IHttpModule
  {

    #region IHttpModule Members

    /// <summary>
    /// Disposes of the resources (other than memory) used by the module 
    /// that implements <see cref="T:System.Web.IHttpModule"></see>.
    /// </summary>
    void IHttpModule.Dispose()
    {
      // Nothing to dispose; 
    }

    /// <summary>
    /// Initializes a module and prepares it to handle requests.
    /// </summary>
    /// <param name="context">An <see cref="T:System.Web.HttpApplication"></see> 
    /// that provides access to the methods, properties, and events common to 
    /// all application objects within an ASP.NET application.
    /// </param>
    void IHttpModule.Init(HttpApplication context)
    {
      if (BlogSettings.Instance.EnableHttpCompression)
        context.BeginRequest += new EventHandler(context_BeginRequest);
    }

    #endregion

    #region Compression

    private const string GZIP = "gzip";
    private const string DEFLATE = "deflate";

    /// <summary>
    /// Handles the BeginRequest event of the context control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    void context_BeginRequest(object sender, EventArgs e)
    {
      HttpApplication app = sender as HttpApplication;
      //压缩aspx页面
      if (app.Request.Url.OriginalString.ToUpperInvariant().Contains(".aspx"))
      {
        //是否支持压缩协议
        if (IsEncodingAccepted(DEFLATE))
        {
          app.Response.Filter = new DeflateStream(app.Response.Filter, CompressionMode.Compress);
          SetEncoding(DEFLATE);
        }
        else if (IsEncodingAccepted(GZIP))
        {
          app.Response.Filter = new GZipStream(app.Response.Filter, CompressionMode.Compress);
          SetEncoding(GZIP);
        }
      }
    }

    /// <summary>
    /// Checks the request headers to see if the specified
    /// encoding is accepted by the client.
    /// </summary>
    private static bool IsEncodingAccepted(string encoding)
    {
      return HttpContext.Current.Request.Headers["Accept-encoding"] != null && HttpContext.Current.Request.Headers["Accept-encoding"].Contains(encoding);
    }

    /// <summary>
    /// Adds the specified encoding to the response headers.
    /// </summary>
    /// <param name="encoding"></param>
    private static void SetEncoding(string encoding)
    {
      HttpContext.Current.Response.AppendHeader("Content-encoding", encoding);
    }

    #endregion

  }
}
5,815