<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[.net－技术研发]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[.net－技术研发]]></description>
<link>http://hi.baidu.com/flashdata</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[Windows CE 5.0 Device Emulator on Windows2003]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/327f8c35f1ab691b90ef39fa.html]]></link>
        <description><![CDATA[
		
		万恶的微软。。。。一个Windows CE 5.0 Device Emulator竟然不能在Windows2003安装。搜了下，找到解决方法如下：
<div style="text-indent: 2em">(下面转自来自：<a href="http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:184"><font color="#0f5d7e" face="宋体">http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:184</font></a>)</div>
<div style="text-indent: 2em"> <wbr></wbr>
<table class="FCK__ShowTableBorders" border="0" cellspacing="2" cellpadding="2" width="100%">
    <tbody class="body">
        <tr>
            <td>
            <p><span >As I mentioned earlier (in my upcoming article for <a href="http://www.thedelphimagazine.com/" target="_blank"><font color="#0f5d7e">The Delphi Magazine</font></a> for example), the system requirements for the Microsoft Windows CE 5.0 Device Emulator list Windows 2000 SP4 or Windows XP SP1 (or later).<br>
            Unfortunately, that's a complete list, since it will simply refuse to install on Windows 2003 (with or without SP1).<br>
            Which is a bummer, since I use Windows 2003 Standard Edition on my laptop (if only because SharePoint 2003 requires Windows 2003).</span></p>
            <center><span ><br>
            <img src="http://www.bobswart.nl/Weblog/gif/CE-Win2K3.jpg"></span></center><br>
            Obviously, I wouldn't just repeat this information if I hadn't found a solution for this issue (at last). The following are the steps required to manually install the Microsoft Windows CE 5.0 Device Emulator on Windows 2003 <strong>(at your own risk!)</strong>.
            <ol>
                <li>Download <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=A120E012-CA31-4BE9-A3BF-B9BF4F64CE72&amp;displaylang=en"><font color="#0f5d7e">Windows CE 5.0 Device Emulator</font></a> (8/27/2004 - 3,770,832 bytes).</li>
                <li>Extract the setup.exe by running it with the /a command-line switch.</li>
            </ol>
            This will not give you the above error message, but after a while presents you with a dialog that explains that the Setup Wizard will create a server image of Microsoft Windows CE 5.0 Emulator at a specified network location.<br>
            You can click Next to specify the location, which can also be on your local disk, so I've specified <font color="#8b0000" size="2" face="courier new">C:\WinCE</font>.<br>
            The result is the following list of files:
            <ul>
                <li><font color="#006400" size="2" face="courier new">C:\WinCE<br>
                </font>
                <div style="margin-left: 2em"><font color="#006400" size="2" face="courier new"><br>
                VMNetSrM.inf<br>
                VMNetSrv.cat<br>
                VMNetSrv.dll<br>
                VMNetSrv.inf<br>
                VMNetSrv.sys<br>
                </font></div>
                </li>
                <li>C:\WinCE\program files\Windows CE 5.0 Emulator<br>
                <div style="margin-left: 2em">Emulator.chm<br>
                Emulator_500.exe<br>
                license.rtf<br>
                NK.cem</div>
                </li>
                <li>C:\WinCE\System<br>
                <div style="margin-left: 2em">msxml4.dll<br>
                msxml4a.dll<br>
                msxml4r.dll</div>
                </li>
                <li>C:\WinCE\Windows\SYSTEM32\Drivers<br>
                <div style="margin-left: 2em">VMM.sys</div>
                </li>
            </ul>
            Running <font color="#8b0000" size="2" face="courier new">Microsoft Windows CE 5.0 Emulator.msi</font> on Windows 2003 will give us the same old error message again, so you can just delete that file.<br>
            <br>
            The <font color="#8b0000" size="2" face="courier new">VMNet*.*</font> files (for the Virtual Machine Network Services Driver) can be installed with the following steps:
            <ol>
                <li value="3">Open the Network Connections (in the Control Panel)</li>
                <li>Right-click on one of the Local Area Connections and select Properties</li>
                <li>Click on Install, and Add a new Service</li>
                <li>In the Select Network Service dialog, click on Have Disk, and then select the <font color="#8b0000" size="2" face="courier new">VMNetSrv.inf</font> file from <font color="#8b0000" size="2" face="courier new">C:\WinCE</font></li>
                <li>Click on OK to install the (unsigned) Virtual Machine Network Services driver</li>
                <li>The <font color="#8b0000" size="2" face="courier new">VMM.sys</font> file must be copied or moved to the <font color="#8b0000" size="2" face="courier new">%WinDir%\system32\Drivers</font> directory</li>
            </ol>
            If MSXML4 is not already installed on your machine, then you also need to perform the following two steps:
            <ol>
                <li value="9">Copy or move the three files from the <font color="#8b0000" size="2" face="courier new">C:\WinCE\System</font> directory to the <font color="#8b0000" size="2" face="courier new">%WinDir%\system32</font> directory</li>
                <li>Run <font color="#8b0000" size="2" face="courier new">regsvr32 msxml4.dll</font> to register msxml4</li>
            </ol>
            Optionally, you can now move the <font color="#8b0000" size="2" face="courier new">C:\WinCE\program files\Windows CE 5.0 Emulator</font> directory to the &quot;normal&quot; <font color="#8b0000" size="2" face="courier new">C:\Program Files</font> directory.<br>
            <br>
            In the end, you can run the emulator as follows:
            <div style="margin-left: 2em"><font color="#8b0000" size="2" face="courier new">emulator_500 /CEImage NK.cem /video 240x320x16 /ethernet shared</font></div>
            <p><br>
            When all this works, you can install the Pocket PC 2003 SDK and Emulator images, too.</p>
            </td>
        </tr>
    </tbody>
</table>
</div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/Win%20Ce">Win Ce</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/327f8c35f1ab691b90ef39fa.html#comment">查看评论</a>]]></description>
        <pubDate>2009-11-03  19:58</pubDate>
        <category><![CDATA[Win Ce]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/327f8c35f1ab691b90ef39fa.html</guid>
</item>

<item>
        <title><![CDATA[c# 控件闪烁处理方法]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/29069416a2c8e55bf3de323e.html]]></link>
        <description><![CDATA[
		
		如果你在Form中绘图的话，不论是不是采用的双缓存，都会看到图片在更新的时候都会不断地闪烁，解决方法就是在这个窗体的构造函数中增加以下三行代码：<br>
<br>
<br>
请在构造函数里面底下加上如下几行：<br>
SetStyle(ControlStyles.UserPaint, true);<br>
SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.<br>
SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲<br>
<br>
参数说明：<br>
<br>
UserPaint <br>
如果为 true，控件将自行绘制，而不是通过操作系统来绘制。此样式仅适用于派生自 Control 的类。<br>
<br>
AllPaintingInWmPaint <br>
如果为 true，控件将忽略 WM_ERASEBKGND 窗口消息以减少闪烁。仅当 UserPaint 位设置为 true 时，才应当应用该样式。 <br>
<br>
DoubleBuffer <br>
如果为 true，则绘制在缓冲区中进行，完成后将结果输出到屏幕上。双重缓冲区可防止由控件重绘引起的闪烁。要完全启用双重缓冲，还必须将 UserPaint 和 AllPaintingInWmPaint 样式位设置为 true。 <br> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/%2Enet%BF%AA%B7%A2">.net开发</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/29069416a2c8e55bf3de323e.html#comment">查看评论</a>]]></description>
        <pubDate>2009-10-09  22:20</pubDate>
        <category><![CDATA[.net开发]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/29069416a2c8e55bf3de323e.html</guid>
</item>

<item>
        <title><![CDATA[读写Excel]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/9cf15de73996a326b9382009.html]]></link>
        <description><![CDATA[
		
		<p> private void button1_Click(object sender, EventArgs e)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  DataTable dt = ReadExcel(@&quot;d:\db.xls&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  DTtoExcel(dt, @&quot;d:\db2.xls&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;param name=&quot;sExcelFile&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;returns&gt;&lt;/returns&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public System.Data.DataTable ReadExcel(string sExcelFile)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  string sConnectionString = &quot;Provider=Microsoft.Jet.Oledb.4.0;Data Source=&quot; + sExcelFile + &quot;;Extended Properties=Excel 8.0&quot;;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  OleDbConnection connection = new OleDbConnection(sConnectionString);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  OleDbDataAdapter adp = new OleDbDataAdapter(&quot;SELECT * FROM testTable&quot;, connection);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  DataSet ds = new DataSet();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  adp.Fill(ds, &quot;Book1&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return ds.Tables[0];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private void DTtoExcel(System.Data.DataTable dt, String fname)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Excel.Application excel = new Excel.Application();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  int rowIndex = 1;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  int colIndex = 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Excel.Workbook xbook = excel.Workbooks.Add(true);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  foreach (DataColumn col in dt.Columns)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  colIndex++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  excel.Cells[1, colIndex] = col.ColumnName;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  foreach (DataRow row in dt.Rows)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  rowIndex++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  colIndex = 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  foreach (DataColumn col in dt.Columns)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  colIndex++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  excel.Cells[rowIndex, colIndex] = row[col.ColumnName].ToString();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  xbook.SaveAs(fname, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Excel.XlSaveAsAccessMode.xlNoChange, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  xbook = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  excel.Quit();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  excel = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/Office">Office</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/9cf15de73996a326b9382009.html#comment">查看评论</a>]]></description>
        <pubDate>2009-04-27  20:25</pubDate>
        <category><![CDATA[Office]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/9cf15de73996a326b9382009.html</guid>
</item>

<item>
        <title><![CDATA[c# 读取写入excel单元格(包括对excel的一些基本操作)]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/5dbcc41126cdcb18b9127b08.html]]></link>
        <description><![CDATA[
		
		<p>以下是一些对excel的一些基本操作<br>
<br>
1:工程对excel类库的导入,如：c:\program files\Microsoft office\offiece11\excel.exe<br>
2:命名控件的引入: using Microsoft.office.Interop.Excel;<br>
<br>
3:如果是对一个已经存在的excel文件进行操作则：<br>
Application app=new Application();<br>
Workbook wbook=app.Workbooks.Open(&quot;c:\\temp.xls&quot;,Type.Missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing);<br>
<br>
Worksheet worksheet=(Worksheet)wbook.Worksheets[1];<br>
<br>
4:如果是新建一个excel文件:<br>
Application app=new Application();<br>
Workbook wbook=app.Workbook.Add(Type.missing);<br>
Worksheet worksheet=(Worksheet)wbook.Worksheets[1];<br>
<br>
5:设置某个单元格里的内容:<br>
worksheet.Cells[1,2]=&quot;列内容&quot;<br>
<br>
6读取某个单元格里的内容<br>
string temp=((Range)worksheet.Cells[1,2]).Text;<br>
<br>
7设置某个单元格里的格式<br>
Excel.Range rtemp=worksheet.get_Range(&quot;A1&quot;,&quot;A1&quot;);<br>
rtemp.Font.Name=&quot;宋体&quot;;<br>
rtemp.Font.FontStyle=&quot;加粗&quot;；<br>
rtemp.Font.Size=5;<br>
<br>
8 保存新建的内容:<br>
worksheet.SaveAs(&quot;c:\\temp.xls&quot;,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing,Type.missing);</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/Office">Office</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/5dbcc41126cdcb18b9127b08.html#comment">查看评论</a>]]></description>
        <pubDate>2009-04-27  20:24</pubDate>
        <category><![CDATA[Office]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/5dbcc41126cdcb18b9127b08.html</guid>
</item>

<item>
        <title><![CDATA[兼容 IE,Firefox 的图片自动缩放 CSS(转）]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/c18a50ee7dbe5bf3b2fb959d.html]]></link>
        <description><![CDATA[
		
		<div class="PostHead">
<p>源地址：<a href="http://hi.baidu.com/hankx/blog/item/084d90451826c03a86947366.html">http://hi.baidu.com/hankx/blog/item/084d90451826c03a86947366.html</a></p>
<p>一直以来有个很头疼的问题困扰着我，那就是图片缩放的问题，写到 JS 里面吧，不太容易修改。写到 CSS 里面吧，IE 6 又不支持 max-width，今天用了很久时间终于解决了这个问题，基本完美了，唯一不完美的就是 IE 6 只有在图片完全下载完成后才会自动调整大小，不过聊胜于无，总比进入页面后看到长长的横向滚动条舒服的多，这里使用了 expression，但是利用了一次加载，所以 expression 不会造成内存泄漏。当然，如果你有更好的解决方案，希望能与我交流。代码如下：</p>
</div>
<div class="PostMain">
<ol class="dp-css">
    <li class="alt"><span><span>.Image {&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">max-width</span><span>:</span><span class="value">600px</span><span>;</span><span class="keyword">height</span><span>:</span><span class="value">auto</span><span>;</span><span class="keyword">cursor</span><span>:</span><span class="value">pointer</span><span>;&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">border</span><span>:</span><span class="value">1px</span><span> </span><span class="value">dashed</span><span> </span><span class="value">#4E6973</span><span>;</span><span class="keyword">padding</span><span>: </span><span class="value">3px</span><span>;&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;  zoom:expression( function(elm) {&nbsp;&nbsp;</span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (elm.width&gt;<span class="value">560</span><span>) {&nbsp;&nbsp;</span></span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  var oldVW = elm.width; elm.width=<span class="value">560</span><span>;&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  elm.height = elm.height*(<span class="value">560</span><span> /oldVW); </span></span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  } </span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  elm.style.zoom = <span class="string">'1'</span><span>; </span></span></li>
    <li class="alt"><span>&nbsp;&nbsp;&nbsp;  }(this)</span><span>);</span></li>
    <li class="alt"><span>} </span></li>
</ol>
</div>
<span><span>
<p class="I18"><span class="hcInfo1">名称：</span>zoom<br>
<span class="hcInfo1">分类：</span><a href="http://www.czbin.cn/hc/CSS.Ie.html">IE专有样式</a><br>
<span class="hcInfo1">简述：</span>设置对象缩放<br>
<span class="hcInfo1">概述：</span>zoom是设置对象缩放的样式(Style)。</p>
<div class="RBox">
<ul class="U3">
    <li class="I9"> </li>
    <li class="I10">
    <h1>zoom详细说明</h1>
    </li>
</ul>
<ul class="U2">
    <li class="I18"><span class="hT1">语法：</span><br>
    <p>zoom : normal | number <br>
    <br>
    <span class="hT1">取值：</span></p>
    normal : 默认值。使用对象的实际尺寸<br>
    number : 百分数 | 无符号浮点实数。浮点实数值为1.0或百分数为100%时相当于此属性的 normal 值<br>
    <br>
    <div class="hCE">
    <ul>说明：<br>
        设置或检索对象的缩放比例。<br>
        设置或更改一个已被呈递的对象的此属性值将导致环绕对象的内容重新流动。<br>
        虽然此属性不可继承，但是它会影响对象的所有子对象( children )。这种影响很像 background 和 filter 属性导致的变化。<br>
        此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。<br>
        对应的脚本特性为 zoom 。</ul>
        <ul>div {zoom : 0.5; }<br>
            .avist { zoom: 0.20 }</ul>
            </div>
            </li>
        </ul>
        </div>
        </span></span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/html%26%2338%3Bcss">html&#38;css</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/c18a50ee7dbe5bf3b2fb959d.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-06  09:39</pubDate>
        <category><![CDATA[html&#38;css]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/c18a50ee7dbe5bf3b2fb959d.html</guid>
</item>

<item>
        <title><![CDATA[IE与Firefox的CSS兼容大全-Web标准教程]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/8b9c890aa2c0b736b1351d5a.html]]></link>
        <description><![CDATA[
		
		<p>CSS对浏览器器的兼容性具有很高的价值，通常情况下IE和Firefox存在很大的解析差异，这里介绍一下兼容要点。</p>
<p class="Hxq563"> </p>
<p> </p>
<p>常见兼容问题：</p>
<p class="Hxq563"> </p>
<p> </p>
<p>1、DOCTYPE 影响 CSS 处理</p>
<p>2、FF：div 设置 margin-left， margin-right 为 auto 时已经居中，IE 不行</p>
<p>3、FF: body 设置 text-align 时， div 需要设置 margin: auto(主要是 margin-left，margin-right) 方可居中</p>
<p>4、FF: 设置 padding 后， div 会增加 height 和 width， 但 IE 不会， 故需要用 !important 多设一个 height 和 width</p>
<p class="Hxq563"> </p>
<p> </p>
<p>5、FF: 支持 !important， IE 则忽略， 可用 !important 为 FF 非凡设置样式</p>
<p>6、div 的垂直居中问题: vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字，就垂直居中了。缺点是要控制内容不要换行</p>
<p>7、cursor: pointer 可以同时在 IE FF 中显示游标手指状， hand 仅 IE 可以</p>
<p>8、FF: 链接加边框和背景色，需设置 display: block， 同时设置 float: left 保证不换行。参照 menubar， 给 a 和 menubar 设置高度是为了避免底边显示错位， 若不设 height， 可以在 menubar 中插入一个空格。</p>
<p class="Hxq563"> </p>
<p> </p>
<p>9、在mozilla firefox和IE中的BOX模型解释不一致导致相差2px解决方法：</p>
<p>div{margin:30px!important;margin:28px;}</p>
<p>注重这两个margin的顺序一定不能写反，据阿捷的说法!important这个属性IE不能识别，但别的浏览器可以识别。所以在IE下其实解释成这样：</p>
<p class="Hxq563"> </p>
<p> </p>
<p>div{maring:30px;margin:28px}</p>
<p>重复定义的话按照最后一个来执行，所以不可以只写margin:XXpx!important;</p>
<p>10、IE5 和IE6的BOX解释不一致</p>
<p>IE5下</p>
<p class="Hxq563"> </p>
<p> </p>
<p>div{width:300px;margin:0 10px 0 10px;}</p>
<p class="Hxq563"> </p>
<p> </p>
<p>div的宽度会被解释为300px-10px(右填充)-10px(左填充)最终div的宽度为280px，而在IE6和其他浏览器上宽度则是以300px 10px(右填充) 10px(左填充)=320px来计算的。这时我们可以做如下修改</p>
<p>div{width:300px!important;width /**/:340px;margin:0 10px 0 10px}</p>
<p>关于这个/**/是什么我也不太明白，只知道IE5和firefox都支持但IE6不支持。</p>
<p>11、ul标签在Mozilla中默认是有padding值的，而在IE中只有margin有值所以先定义</p>
<p class="Hxq563"> </p>
<p> </p>
<p>ul{margin:0;padding:0;}</p>
<p>就能解决大部分问题</p>
<p>注重事项：</p>
<p class="Hxq563"> </p>
<p> </p>
<p>1、float的div一定要闭合。</p>
<p>例如：(其中floatA、floatB的属性已经设置为float:left;)</p>
<p>&lt;#div id=&quot;floatA&quot; &gt;&lt;/#div&gt;</p>
<p>&lt;#div id=&quot;floatB&quot; &gt;&lt;/#div&gt;</p>
<p>&lt;#div id=&quot;NOTfloatC&quot; &gt;&lt;/#div&gt;</p>
<p class="Hxq563"> </p>
<p> </p>
<p>这里的NOTfloatC并不希望继续平移，而是希望往下排。</p>
<p class="Hxq563"> </p>
<p> </p>
<p>这段代码在IE中毫无问题，问题出在FF。原因是NOTfloatC并非float标签，必须将float标签闭合。</p>
<p>在</p>
<p class="Hxq563"> </p>
<p> </p>
<p>&lt;#div class=&quot;floatB&quot;&gt;&lt;/#div&gt;</p>
<p>&lt;#div class=&quot;NOTfloatC&quot;&gt;&lt;/#div&gt;</p>
<p>之间加上</p>
<p>&lt;#div class=&quot;clear&quot;&gt;&lt;/#div&gt;</p>
<p class="Hxq563"> </p>
<p> </p>
<p>这个div一定要注重声明位置，一定要放在最恰当的地方，而且必须与两个具有float属性的div同级，之间不能存在嵌套关系，否则会产生异常。</p>
<p>并且将clear这种样式定义为为如下即可：</p>
<p>.clear{</p>
<p>clear:both;}</p>
<p>此外，为了让高度能自动适应，要在wrapper里面加上overflow:hidden;</p>
<p>当包含float的box的时候，高度自动适应在IE下无效，这时候应该触发IE的layout私有属性(万恶的IE啊！)用zoom:1;可以做到，这样就达到了兼容。</p>
<p>例如某一个wrapper如下定义：</p>
<p>
<table class="FCK__ShowTableBorders" style="border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; border-bottom: #cccccc 1px dotted" cellspacing="0" cellpadding="6" width="95%" align="center" border="0">
    <tbody>
        <tr>
            <td style="word-wrap: break-word" bgcolor="#fdfddf">以下为引用的内容：<br>
            .colwrapper{<br>
            overflow:hidden;<br>
            zoom:1;<br>
            margin:5px auto;}</td>
        </tr>
    </tbody>
</table>
</p>
<p class="Hxq563"> </p>
<p> </p>
<p>2、margin加倍的问题。</p>
<p>设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。</p>
<p>解决方案</p>
<p>是在这个div里面加上display:inline;</p>
<p>例如：</p>
<p>&lt;#div id=&quot;imfloat&quot;&gt;&lt;/#div&gt;</p>
<p class="Hxq563"> </p>
<p> </p>
<p>相应的css为</p>
<p class="Hxq563"> </p>
<p> </p>
<p>
<table class="FCK__ShowTableBorders" style="border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; border-bottom: #cccccc 1px dotted" cellspacing="0" cellpadding="6" width="95%" align="center" border="0">
    <tbody>
        <tr>
            <td style="word-wrap: break-word" bgcolor="#fdfddf">以下为引用的内容：<br>
            #IamFloat{<br>
            float:left;<br>
            margin:5px;/*IE下理解为10px*/<br>
            display:inline;/*IE下再理解为5px*/}</td>
        </tr>
    </tbody>
</table>
</p>
<p>3、关于容器的包涵关系</p>
<p class="Hxq563"> </p>
<p> </p>
<p>很多时候，尤其是容器内有平行布局，例如两、三个float的div时，宽度很轻易出现问题。在IE中，外层的宽度会被内层更宽的div挤破。一定要用Photoshop或者Firework量取像素级的精度。</p>
<p>4、关于高度的问题</p>
<p class="Hxq563"> </p>
<p> </p>
<p>假如是动态地添加内容，高度最好不要定义。浏览器可以自动伸缩，然而假如是静态的内容，高度最好定好。（似乎有时候不会自动往下撑开，不知道具体怎么回事）</p>
<p class="Hxq563"> </p>
<p> </p>
<p>5、最狠的手段 - !important;</p>
<p>假如实在没有办法解决一些细节问题，可以用这个方法.FF对于&quot;!important&quot;会自动优先解析，然而IE则会忽略。如下</p>
<p>
<table class="FCK__ShowTableBorders" style="border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; border-bottom: #cccccc 1px dotted" cellspacing="0" cellpadding="6" width="95%" align="center" border="0">
    <tbody>
        <tr>
            <td style="word-wrap: break-word" bgcolor="#fdfddf">以下为引用的内容：<br>
            .tabd1{<br>
            background:url(/res/images/up/tab1.gif) no-repeat 0px 0px !important; /*Style for FF*/<br>
            background:url(/res/images/up/tab1.gif) no-repeat 1px 0px; /* Style for IE */}</td>
        </tr>
    </tbody>
</table>
</p>
<p class="Hxq563"> </p>
<p> </p>
<p>值得注重的是，一定要将xxxx !important 这句放置在另一句之上，上面已经提过 undefined undefined</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/html%26%2338%3Bcss">html&#38;css</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/8b9c890aa2c0b736b1351d5a.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-04  15:17</pubDate>
        <category><![CDATA[html&#38;css]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/8b9c890aa2c0b736b1351d5a.html</guid>
</item>

<item>
        <title><![CDATA[IE和FireFox在js和css的23处不同点(转贴)]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/331a3cfa14db70819e514658.html]]></link>
        <description><![CDATA[
		
		<strong>1.document.formName.item(&quot;itemName&quot;) 问题</strong> <br>
问题说明：IE下，可以使用 document.formName.item(&quot;itemName&quot;) 或 document.formName.elements [&quot;elementName&quot;]；Firefox下，只能使用document.formName.elements[&quot;elementName&quot;]。<br>
解决方法：统一使用document.formName.elements[&quot;elementName&quot;]。<br>
<br>
<strong>2.集合类对象问题</strong><br>
问题说明：IE下，可以使用 () 或 [] 获取集合类对象；Firefox下，只能使用 [ ]获取集合类对象。<br>
解决方法：统一使用 [] 获取集合类对象。<br>
<br>
<strong>3.自定义属性问题</strong><br>
问题说明：IE下，可以使用获取常规属性的方法来获取自定义属性，也可以使用 getAttribute() 获取自定义属性；Firefox下，只能使用 getAttribute() 获取自定义属性。<br>
解决方法：统一通过 getAttribute() 获取自定义属性。<br>
<br>
<strong>4.eval(&quot;idName&quot;)问题</strong><br>
问题说明：IE下，可以使用 eval(&quot;idName&quot;) 或 getElementById(&quot;idName&quot;) 来取得 id 为 idName 的HTML对象；Firefox下，只能使用 getElementById(&quot;idName&quot;) 来取得 id 为 idName 的HTML对象。<br>
解决方法：统一用 getElementById(&quot;idName&quot;) 来取得 id 为 idName 的HTML对象。<br>
<br>
<strong>5.变量名与某HTML对象ID相同的问题</strong><br>
问题说明：IE下，HTML对象的ID可以作为 document 的下属对象变量名直接使用，Firefox下则不能；Firefox下，可以使用与HTML对象ID相同的变量名，IE下则不能。<br>
解决方法：使用 document.getElementById(&quot;idName&quot;) 代替 document.idName。最好不要取HTML对象ID相同的变量名，以减少错误；在声明变量时，一律加上var关键字，以避免歧义。<br>
<br>
<strong>6.const问题</strong><br>
问题说明：Firefox下，可以使用const关键字或var关键字来定义常量；IE下，只能使用var关键字来定义常量。<br>
解决方法：统一使用var关键字来定义常量。<br>
<br>
<strong>7.input.type属性问题</strong><br>
问题说明：IE下 input.type 属性为只读；但是Firefox下 input.type 属性为读写。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  解决办法：不修改 input.type 属性。如果必须要修改，可以先隐藏原来的input，然后在同样的位置再插入一个新的input元素。<br>
<br>
<strong>8.window.event问题</strong><br>
问题说明：window.event 只能在IE下运行，而不能在Firefox下运行，这是因为Firefox的event只能在事件发生的现场使用。<br>
解决方法：在事件发生的函数上加上event参数，在函数体内(假设形参为evt)使用 var myEvent = evt?evt:(window.event?window.event:null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  示例：&lt;input type=&quot;button&quot; onclick=&quot;doSomething(event)&quot;/&gt; <br>
&lt;script language=&quot;javascript&quot;&gt; <br>
function doSomething(evt) { <br>
var myEvent = evt?evt:(window.event?window.event:null)<br>
... <br>
}<br>
<br>
<strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  9.event.x与event.y问题</strong><br>
问题说明：IE下，even对象有x、y属性，但是没有pageX、pageY属性；Firefox下，even对象有pageX、pageY属性，但是没有x、y属性。<br>
<span>解决</span>方法：var myX = event.x ? event.x : event.pageX; var myY = event.y ? event.y:event.pageY;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  如果考虑第8条问题，就改用myEvent代替event即可。<br>
<br>
<strong>10.event.srcElement问题</strong><br>
问题说明：IE下，even对象有srcElement属性，但是没有target属性；Firefox下，even对象有target属性，但是没有srcElement属性。<br>
解决方法：使用srcObj = event.srcElement ? event.srcElement : event.target;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  如果考虑第8条问题，就改用myEvent代替event即可。<br>
<br>
<strong>11.window.location.href问题</strong><br>
问题说明：IE或者Firefox2.0.x下，可以使用window.location或window.location.href；Firefox1.5.x下，只能使用window.location。<br>
解决方法：使用 window.location 来代替 window.location.href。当然也可以考虑使用 location.replace()方法。<br>
<br>
<strong>12.模态和非模态窗口问题</strong><br>
问题说明：IE下，可以通过showModalDialog和showModelessDialog打开模态和非模态窗口；Firefox下则不能。<br>
解决方法：直接使用 window.open(pageURL,name,parameters) 方式打开新窗口。 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  如果<span>需要</span>将子窗口中的参数传递回父窗口，可以在子窗口中使用window.opener来访问父窗口。如果需要父窗口控制子窗口的话，使用var subWindow = window.open(pageURL,name,parameters); 来获得新开的窗口对象。<br>
<br>
<strong>13.frame和iframe问题</strong><br>
以下面的frame为例： <br>
&lt;frame src=&quot;xxx.html&quot; id=&quot;frameId&quot; name=&quot;frameName&quot; /&gt; <br>
(1)访问frame对象<br>
IE：使用window.frameId或者window.frameName来访问这个frame对象；<br>
Firefox：使用window.frameName来访问这个frame对象；<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  解决方法：统一使用 window.document.getElementById(&quot;frameId&quot;) 来访问这个frame对象；<br>
<br>
(2)切换frame内容<br>
在IE和Firefox中都可以使用window.document.getElementById(&quot;frameId&quot;).src = &quot;xxx.html&quot;或window.frameName.location = &quot;xxx.html&quot;来切换frame的内容；<br>
如果需要将frame中的参数传回父窗口，可以在frame中使用parent关键字来访问父窗口。<br>
<br>
<strong>14.body载入问题</strong><br>
问题说明：Firefox的body对象在body标签没有被浏览器完全读入之前就存在；而IE的body对象则必须在body标签被浏览器完全读入之后才存在。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 这个问题尚未实际验证，待验证后再来修改。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 经验证，IE6、Opera9以及FireFox2中不存在上述问题，单纯的JS脚本可以访问在脚本之前已经载入的所有对象和元素，即使这个元素还没有载入完成。<br>
<br>
<strong>15. 事件委托方法</strong><br>
问题说明：IE下，使用 document.body.onload = inject; 其中function inject()在这之前已被<span>实现；在F</span>irefox下，使用 document.body.onload = inject();<br>
解决方法：统一使用 document.body.onload=new Function('inject()'); 或者 document.body.onload = function(){/* 这里是代码 */}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注意] Function和function的区别<br>
<br>
<strong>16.访问的父元素的区别</strong><br>
问题说明：在IE下，使用 obj.parentElement 或 obj.parentNode 访问obj的父结点；在firefox下，使用 obj.parentNode 访问obj的父结点。<br>
<span>解决</span>方法：因为firefox与IE都支持DOM，因此统一使用obj.parentNode 来访问obj的父结点。<br>
<br>
<strong>17.cursor:hand VS cursor:pointer</strong><br>
问题说明：firefox不支持hand，但ie支持pointer ，两者都是手形指示。<br>
解决方法：统一使用pointer。<br>
<br>
<strong>18.innerText的问题.</strong><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  问题说明：innerText在IE中能正常<span>工作</span>，但是innerText在FireFox中却不行。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  解决方法：在非IE浏览器中使用textContent代替innerText。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  示例：<br>
if(navigator.appName.indexOf(&quot;Explorer&quot;) &gt;-1){ <br>
document.getElementById('element').innerText = &quot;my text&quot;; <br>
} else{ <br>
document.getElementById('element').textContent = &quot;my text&quot;; <br>
} <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] innerHTML 同时被ie、firefox等浏览器支持，其他的，如outerHTML等只被ie支持，最好不用。<br>
<br>
<strong>19. 对象宽高赋值问题<br>
</strong>　　问题说明：FireFox中类似 obj.style.height = imgObj.height 的语句无效。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  解决方法：统一使用 obj.style.height = imgObj.height + 'px';<br>
<br>
<strong>20. Table操作问题<br>
</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  问题说明：ie、firefox以及其它浏览器对于 table 标签的操作都各不相同，在ie中不允许对table和tr的innerHTML赋值，使用js增加一个tr时，使用appendChild方法也不管用。<br>
解决方法：<br>
//向table追加一个空行： <br>
var row = otable.insertRow(-1); <br>
var cell = document.createElement(&quot;td&quot;); <br>
cell.innerHTML = &quot;&quot;; <br>
cell.className = &quot;XXXX&quot;; <br>
row.appendChild(cell); <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 由于俺很少使用JS直接操作表格，这个问题没有遇见过。建议使用JS框架集来操作table，如JQuery。<br>
<br>
<strong>21. ul和ol列表缩进问题<br>
</strong>　　消除ul、ol等列表的缩进时，样式应写成：list-style:none;margin:0px;padding:0px; <br>
其中margin属性对IE有效，padding属性对FireFox有效。← 此句表述有误，详细见↓<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 这个问题尚未实际验证，待验证后再来修改。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 经验证，在IE中，设置margin:0px可以去除列表的上下左右缩进、空白以及列表编号或圆点，设置padding对样式没有影响；在Firefox 中，设置margin:0px仅仅可以去除上下的空白，设置padding:0px后仅仅可以去掉左右缩进，还必须设置list-style:none才 能去除列表编号或圆点。也就是说，在IE中仅仅设置margin:0px即可达到最终效果，而在Firefox中必须同时设置margin:0px、 padding:0px以及list-style:none三项才能达到最终效果。<br>
<br>
<strong>22. CSS透明问题</strong><br>
IE：filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60)。 <br>
FF：opacity:0.6。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 最好两个都写，并将opacity属性放在下面。<br>
<br>
<strong>23. CSS圆角问题</strong><br>
IE：ie7以下版本不支持圆角。<br>
FF： -moz-border-radius:4px，或者-moz-border-radius-topleft:4px;-moz-border- radius-topright:4px;-moz-border-radius-bottomleft:4px;-moz-border- radius- bottomright:4px;。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [注] 圆角问题是CSS中的经典问题，建议使用JQuery框架集来设置圆角，让这些复杂的问题留给别人去想吧。<br>
<br>
关于CSS中的问题实在太多了，甚至同样的CSS定义在不同的页面标准中的显示效果都是不一样的。一个合乎发展的建议是，页面采用标准DHTML标准 编写，较少使用table，CSS定义尽量依照标准DOM，同时兼顾IE、Firefox、Opera等主流浏览器。BTW，很多情况下，FF和 Opera的CSS解释标准更贴近CSS标准，也更具有规范性。 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/html%26%2338%3Bcss">html&#38;css</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/331a3cfa14db70819e514658.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-04  15:13</pubDate>
        <category><![CDATA[html&#38;css]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/331a3cfa14db70819e514658.html</guid>
</item>

<item>
        <title><![CDATA[js图片缩放效果]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/2e2079cfe9309735f9dc6179.html]]></link>
        <description><![CDATA[
		
		 &lt;html&gt;<br>
 &lt;head&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;title&gt;无标题页&lt;/title&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;script language=&quot;javascript&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (window.addEventListener)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  window.addEventListener('DOMMouseScroll', wheel, false);//给firefox添加鼠标滚动事件<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //else<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  // window.onmousewheel = document.onmousewheel = wheel;//ie<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>
&nbsp;&nbsp;&nbsp;  function wheel(event)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  var delta = 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  var div = document.getElementById(&quot;div1&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (!event) /**//* For IE. */<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  event = window.event;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (event.wheelDelta)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //让一个是IE<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //if(event.srcElement.tagName==&quot;IMG&quot; &amp;&amp; div.contains(event.srcElement))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //event.srcElement.width+=event.wheelDelta/15;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  // return false;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  } <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  else if (event.detail) <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  //如果是firefox<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  var allImg = div.getElementsByTagName(&quot;IMG&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  var isThis=false;//现判断鼠标中仑的元素是不是包含在那个div里面<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  for(i=0;i&lt;allImg.length;i++)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if(allImg[i]==event.target)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  isThis=true;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if(isThis &amp;&amp; event.target.tagName==&quot;IMG&quot;)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  event.target.width=event.target.width+event.detail*12;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  event.returnValue = false;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return true;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  function bbimg(o)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  var zoom=parseInt(o.style.zoom, 10)||100;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  zoom+=event.wheelDelta/12;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (zoom&gt;0) o.style.zoom=zoom+'%';<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return false;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  &lt;/script&gt;<br>
&lt;/head&gt;<br>
&lt;body&gt;<br>
&nbsp;&nbsp;&nbsp;  &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;  &lt;div&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;div id=&quot;div1&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;table class=&quot;tablebody2&quot; style=&quot;table-layout:fixed;&quot; border=&quot;0&quot; width=&quot;90%&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;td&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;img id=&quot;11&quot; src=&quot;<a href="http://www.google.cn/intl/zh-CN/images/logo_cn.gif">http://www.google.cn/intl/zh-CN/images/logo_cn.gif</a>&quot; onclick=&quot;javascript:window.open(this.src);&quot; <br>
style=&quot;cursor: pointer;&quot; onload=&quot;javascript:if(this.width&gt;screen.width-500)this.style.width=screen.width-500;&quot; <br>
onmousewheel=&quot;return bbimg(this)&quot; border=&quot;0&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/td&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/tr&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/table&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/div&gt;<br>
&nbsp;&nbsp;&nbsp;  &lt;/form&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/javascript%BA%CDajax">javascript和ajax</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/2e2079cfe9309735f9dc6179.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-03  15:26</pubDate>
        <category><![CDATA[javascript和ajax]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/2e2079cfe9309735f9dc6179.html</guid>
</item>

<item>
        <title><![CDATA[IE与Firefox等浏览器之间对容器width的不同解释及解决办法]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/111e7a8db018311ab31bbaf1.html]]></link>
        <description><![CDATA[
		
		<span class="Apple-style-span" style="word-spacing: 0px; font: 14px/21px simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><br class="Apple-interchange-newline">
<div forimg="1"><img class="blogimg" border="0" small="0" src="http://moban.powereasy.net/Lectures/UploadFiles_3793/200702/20070205104604812.gif"></div>
<br>
<p style="font-size: 12px">图片中：CSS 'width' 指的是标准CSS中所指的width的宽度，在firefox，opera等中的宽度就是这个宽度。它只包含容器中内容的宽度。</p>
<p style="font-size: 12px">而Internet Explorer 'width'则是指整个容器的宽度，包括内容，padding ，border。</p>
<p style="font-size: 12px">所谓的CSS的宽度的加法减法就指这里不同浏览器对width解析得到的不同结果。</p>
<p style="font-size: 12px">Firefox中是加法：容器占的宽度=内容宽度+padding宽度+border宽度</p>
<p style="font-size: 12px">IE中是减法：内容宽度=您定义的容器宽度(Internet Explorer 'width')-padding宽度-border宽度</p>
<p style="font-size: 12px">大家区分的时候重点是分清：内容宽度和容器所占宽度这两个的不同</p>
<p style="font-size: 12px"> </p>
<p style="font-size: 12px">由于以上差别的存在，必然造成定义的一个容器宽度在不同浏览器中显示出不同的效果来。解决办法主要有两种：</p>
<p style="font-size: 12px">一种是写hack<br>
一种是采取在当前容器中再增加一个div的方法来解决。</p>
<p style="font-size: 12px">写hack：<br>
给不同的浏览器写一个不同的width： div.aa{width:100px; *width:120px;}Firefox等浏览器只能认出前一个width来，因此它会认为这个div容器的宽度是100px，而IE6等浏览器则两个都能认出来，但是根据优先级，写在后面的会被采纳，因此IE6会认为这个div容器的宽度是120px；</p>
<p style="font-size: 12px">增加一个div或者其它容器的方法：<br>
div结构是：<br>
&lt;div class=&quot;aa&quot;&gt;&lt;div&gt;内容放在这里&lt;/div&gt;&lt;/div&gt;，<br>
CSS代码是：<br>
.aa{width:120px;}<br>
.aa div{padding:10px;}<br>
将padding border与width分开来写，分到不同的div里面，既不用做加法，也不用做减法，外面的div直接采用我们给它指定的宽度。</p>
<p style="font-size: 12px">源地址：<a href="http://moban.powereasy.net/Lectures/DIV/718.html">http://moban.powereasy.net/Lectures/DIV/718.html</a></p>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/html%26%2338%3Bcss">html&#38;css</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/111e7a8db018311ab31bbaf1.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-03  11:01</pubDate>
        <category><![CDATA[html&#38;css]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/111e7a8db018311ab31bbaf1.html</guid>
</item>

<item>
        <title><![CDATA[跨浏览器的 inline-block 实现[CSS]]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/66d630db5b915a6ed0164ef6.html]]></link>
        <description><![CDATA[
		
		<span class="Apple-style-span" style="word-spacing: 0px; font: 12px Arial; text-transform: none; color: rgb(51,51,51); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; text-align: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0">
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">最近在为自己做个新站，想到了些效果，实现时碰到了些小麻烦，比如这个 inline block。所幸大多数问题都解决了，所以写出来分享一下。</p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">我们在制作网页时，有时会希望一个元素既能像 block 一样定义宽度和高度，又可以像普通的 inline 一样不断行。例如下面这张图片中红线标出的地方：</p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px"><a style="color: rgb(0,153,204); text-decoration: none" href="http://blog.istef.info/wp-content/uploads/2008/10/final-result.jpg"><img class="alignnone size-full wp-image-1862" title="inline-block" style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" height="81" width="397" src="http://blog.istef.info/wp-content/uploads/2008/10/final-result.jpg"></a></p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">通常我们实现这样的效果会使用这样的代码：</p>
<blockquote>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">&lt;a href=&rdquo;#&rdquo;&gt;&lt;img src=&rdquo;….&rdquo; alt=&rdquo;….&rdquo; /&gt;&lt;/a&gt;</p>
</blockquote>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">这样虽然可以达到目的，但相对来说代码还是不够精炼，也不够灵活。而理想的方式，我们仅通过下面的代码即可实现：</p>
<blockquote>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">&lt;a href=&rdquo;#&rdquo;&gt;Yangliu.name&lt;/a&gt;</p>
</blockquote>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">这样一来，我们就需要对 a 标签指定 width height 和 background-image。但 a 标签默认的 display 属性是 inline，width、height 是无效的。而如果对 a 设置 display:block，虽然可以解决宽度高度的问题，但元素会自动断行，无法达到我们需要的效果。有没有什么方式可以实现类似 img 标签那样，既可以设定高度宽度，又不会自动断行呢？</p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">答案是肯定的。在 Opera 和 Webkit 中支持一个 CSS2 的属性 display: inline-block。利用这个属性，在 Opera 下即可完全实现我们所需的效果，但在其它浏览器下就不行了。</p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">display 属性另外还有一个不太常用的值 display: inline-table。利用这个值也可以完全实现我们所需的效果。这个属性被除了 IE 以外的所有浏览器正确支持，但是…… 呃，又是 IE。虽然在面对 CSS 的时候所有 Web Developer 都会恨之入骨，但放弃 IE 就等于放弃 70% 的用户，所以我们还是得找出其它的解决方案。</p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">没辙了，只好 Google，结果还真给我<a style="color: rgb(0,153,204); text-decoration: none" target="_blank" href="http://foohack.com/2007/11/cross-browser-support-for-inline-block-styling/">找到了</a>。在这篇文章中指出，如果你首先触发 IE 的 hasLayout，然后再设置它的 display: inline，这个元素将变为 inline-block! 这样一来，我们就可以利用 IE 这个不可理喻的特点，结合一些 CSS Hacks，给出兼容各种浏览器的 CSS 代码：</p>
<blockquote>
<pre>.<strong><em>element-class</em></strong> {
    display: -moz-inline-stack;  //Firefox only code
    display: inline-block;       //some standard browsers
    zoom: 1;                     //IE only
    *display: inline;            //Only IE know this code (CSS Hack)
}</pre>
</blockquote>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">通过这样的代码就可以实现在各种浏览器中表现一致的 inline-block 了。不过这种方式有个小缺憾，就是无法通过 W3C CSS 验证。当然，要想通过验证也很简单，可以对除了 IE 之外的浏览器发出 inline-table 属性的样式表，对于 IE 单独发出一份 IE Only 的 CSS。</p>
<p style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 0px 12px; color: rgb(51,51,51); line-height: 150%; padding-top: 0px">源地址：<a href="http://blog.istef.info/2008/10/13/cross-browser-inline-block-css/">http://blog.istef.info/2008/10/13/cross-browser-inline-block-css/</a></p>
</span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/html%26%2338%3Bcss">html&#38;css</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/66d630db5b915a6ed0164ef6.html#comment">查看评论</a>]]></description>
        <pubDate>2009-03-03  10:57</pubDate>
        <category><![CDATA[html&#38;css]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/66d630db5b915a6ed0164ef6.html</guid>
</item>

<item>
        <title><![CDATA[system.windows.form.datagridview]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/8014c03da7d439cf9f3d6225.html]]></link>
        <description><![CDATA[
		
		<span class="Apple-style-span" style="word-spacing: 0px; font: 16px Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><span class="Apple-style-span" >
<pre><div><span style="vertical-align: middle; color: rgb(0,0,255)">using</span><span style="vertical-align: middle; color: rgb(0,0,0)"> System;
</span><span style="vertical-align: middle; color: rgb(0,0,255)">using</span><span style="vertical-align: middle; color: rgb(0,0,0)"> System.Drawing;
</span><span style="vertical-align: middle; color: rgb(0,0,255)">using</span><span style="vertical-align: middle; color: rgb(0,0,0)"> System.Windows.Forms;

</span><span style="vertical-align: middle; color: rgb(0,0,255)">public</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">class</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Form1 : Form
{
    </span><span style="vertical-align: middle; color: rgb(0,0,255)">private</span><span style="vertical-align: middle; color: rgb(0,0,0)"> DataGridView dataGridView1 </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> DataGridView();
    </span><span style="vertical-align: middle; color: rgb(0,0,255)">private</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Bitmap highPriImage;
    </span><span style="vertical-align: middle; color: rgb(0,0,255)">private</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Bitmap mediumPriImage;
    </span><span style="vertical-align: middle; color: rgb(0,0,255)">private</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Bitmap lowPriImage;

    </span><span style="vertical-align: middle; color: rgb(0,0,255)">public</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Form1()
    {
        </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Initialize the images. </span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">        </span><span style="vertical-align: middle; color: rgb(0,0,255)">try</span><span style="vertical-align: middle; color: rgb(0,0,0)">
        {
            highPriImage </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Bitmap(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">highPri.bmp</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
            mediumPriImage </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Bitmap(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">mediumPri.bmp</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
            lowPriImage </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Bitmap(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">lowPri.bmp</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
        }
        </span><span style="vertical-align: middle; color: rgb(0,0,255)">catch</span><span style="vertical-align: middle; color: rgb(0,0,0)"> (ArgumentException)
        {
            MessageBox.Show(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">The Priority column requires Bitmap images </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,0)">+</span><span style="vertical-align: middle; color: rgb(0,0,0)">
                </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">named highPri.bmp, mediumPri.bmp, and lowPri.bmp </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,0)">+</span><span style="vertical-align: middle; color: rgb(0,0,0)">
                </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">residing in the same directory as the executable file.</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
        }

        </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Initialize the DataGridView.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">        dataGridView1.Dock </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> DockStyle.Fill;
        dataGridView1.AllowUserToAddRows </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">false</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
        dataGridView1.Columns.AddRange(
            </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> DataGridViewTextBoxColumn(),
            </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> DataGridViewImageColumn());
        dataGridView1.Columns[</span><span style="vertical-align: middle; color: rgb(128,0,128)">0</span><span style="vertical-align: middle; color: rgb(0,0,0)">].Name </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">Balance</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
        dataGridView1.Columns[</span><span style="vertical-align: middle; color: rgb(128,0,128)">1</span><span style="vertical-align: middle; color: rgb(0,0,0)">].Name </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">Priority</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
        dataGridView1.Rows.Add(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">-100</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">, </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">high</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
        dataGridView1.Rows.Add(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">0</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">, </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">medium</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
        dataGridView1.Rows.Add(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">100</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">, </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">low</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">);
        dataGridView1.CellFormatting </span><span style="vertical-align: middle; color: rgb(0,0,0)">+=</span><span style="vertical-align: middle; color: rgb(0,0,0)">
            </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> System.Windows.Forms.DataGridViewCellFormattingEventHandler(
            </span><span style="vertical-align: middle; color: rgb(0,0,255)">this</span><span style="vertical-align: middle; color: rgb(0,0,0)">.dataGridView1_CellFormatting);
        </span><span style="vertical-align: middle; color: rgb(0,0,255)">this</span><span style="vertical-align: middle; color: rgb(0,0,0)">.Controls.Add(dataGridView1);
    }

    </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Changes how cells are displayed depending on their columns and values.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">    </span><span style="vertical-align: middle; color: rgb(0,0,255)">private</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">void</span><span style="vertical-align: middle; color: rgb(0,0,0)"> dataGridView1_CellFormatting(</span><span style="vertical-align: middle; color: rgb(0,0,255)">object</span><span style="vertical-align: middle; color: rgb(0,0,0)"> sender, 
        System.Windows.Forms.DataGridViewCellFormattingEventArgs e)
    {
        </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Set the background to red for negative values in the Balance column.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">        </span><span style="vertical-align: middle; color: rgb(0,0,255)">if</span><span style="vertical-align: middle; color: rgb(0,0,0)"> (dataGridView1.Columns[e.ColumnIndex].Name.Equals(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">Balance</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">))
        {
            Int32 intValue;
            </span><span style="vertical-align: middle; color: rgb(0,0,255)">if</span><span style="vertical-align: middle; color: rgb(0,0,0)"> (Int32.TryParse((String)e.Value, </span><span style="vertical-align: middle; color: rgb(0,0,255)">out</span><span style="vertical-align: middle; color: rgb(0,0,0)"> intValue) </span><span style="vertical-align: middle; color: rgb(0,0,0)">&amp;&amp;</span><span style="vertical-align: middle; color: rgb(0,0,0)"> 
                (intValue </span><span style="vertical-align: middle; color: rgb(0,0,0)">&lt;</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(128,0,128)">0</span><span style="vertical-align: middle; color: rgb(0,0,0)">))
            {
                e.CellStyle.BackColor </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Color.Red;
                e.CellStyle.SelectionBackColor </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Color.DarkRed;
            }
        }

        </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Replace string values in the Priority column with images.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">        </span><span style="vertical-align: middle; color: rgb(0,0,255)">if</span><span style="vertical-align: middle; color: rgb(0,0,0)"> (dataGridView1.Columns[e.ColumnIndex].Name.Equals(</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">Priority</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">))
        {
            </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Ensure that the value is a string.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">            String stringValue </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> e.Value </span><span style="vertical-align: middle; color: rgb(0,0,255)">as</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">string</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
            </span><span style="vertical-align: middle; color: rgb(0,0,255)">if</span><span style="vertical-align: middle; color: rgb(0,0,0)"> (stringValue </span><span style="vertical-align: middle; color: rgb(0,0,0)">==</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">null</span><span style="vertical-align: middle; color: rgb(0,0,0)">) </span><span style="vertical-align: middle; color: rgb(0,0,255)">return</span><span style="vertical-align: middle; color: rgb(0,0,0)">;

            </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Set the cell ToolTip to the text value.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">            DataGridViewCell cell </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> dataGridView1[e.ColumnIndex, e.RowIndex];
            cell.ToolTipText </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> stringValue;

            </span><span style="vertical-align: middle; color: rgb(0,128,0)">//</span><span style="vertical-align: middle; color: rgb(0,128,0)"> Replace the string value with the image value.</span><span style="vertical-align: middle; color: rgb(0,128,0)">
</span><span style="vertical-align: middle; color: rgb(0,0,0)">            </span><span style="vertical-align: middle; color: rgb(0,0,255)">switch</span><span style="vertical-align: middle; color: rgb(0,0,0)"> (stringValue)
            {
                </span><span style="vertical-align: middle; color: rgb(0,0,255)">case</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">high</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">:
                    e.Value </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> highPriImage;
                    </span><span style="vertical-align: middle; color: rgb(0,0,255)">break</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
                </span><span style="vertical-align: middle; color: rgb(0,0,255)">case</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">medium</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">:
                    e.Value </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> mediumPriImage;
                    </span><span style="vertical-align: middle; color: rgb(0,0,255)">break</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
                </span><span style="vertical-align: middle; color: rgb(0,0,255)">case</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">low</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">:
                    e.Value </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> lowPriImage;
                    </span><span style="vertical-align: middle; color: rgb(0,0,255)">break</span><span style="vertical-align: middle; color: rgb(0,0,0)">;
            }
        }
    }

    </span><span style="vertical-align: middle; color: rgb(0,0,255)">public</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">static</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">void</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Main()
    {
        Application.Run(</span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> Form1());
    }

}
</span></div></pre>
</span></span><br class="Apple-interchange-newline"> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/%2Enet%BF%AA%B7%A2">.net开发</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/8014c03da7d439cf9f3d6225.html#comment">查看评论</a>]]></description>
        <pubDate>2009-02-28  16:02</pubDate>
        <category><![CDATA[.net开发]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/8014c03da7d439cf9f3d6225.html</guid>
</item>

<item>
        <title><![CDATA[getfirstVisibleRow]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/85cdfe03d63fa1e408fa93b2.html]]></link>
        <description><![CDATA[
		
		<span class="Apple-style-span" style="word-spacing: 0px; font: 16px  times new roman ; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><span class="Apple-style-span" style="font-size: 12px; color: rgb(48,48,48); ">In C#,I know the way to get:<br>
void EnsureRowVisible(DataGrid grd, int Row)<br>
{<br>
int FirstVisibleRow = (int)grd.GetType().GetField(&quot;m_irowVisibleFirst&quot;,<br>
BindingFlags.NonPublic|BindingFlags.GetField<br>
|BindingFlags.Instance).GetValue(grid);<br>
int LastVisibleRow = (int)grd.GetType().GetField(&quot;m_irowVisibleLast&quot;,<br>
BindingFlags.NonPublic|BindingFlags.GetField|Bindi ngFlags.Instance).GetValue<br>
(grid);<br>
//grid is the visible datagrid control<br>
}</span></span> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/Win%20Ce">Win Ce</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/85cdfe03d63fa1e408fa93b2.html#comment">查看评论</a>]]></description>
        <pubDate>2009-02-28  13:14</pubDate>
        <category><![CDATA[Win Ce]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/85cdfe03d63fa1e408fa93b2.html</guid>
</item>

<item>
        <title><![CDATA[重绘.net Compact Framework下的DataGrid单元格样式（终极方案）]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/4e1c45085453e2920a7b821f.html]]></link>
        <description><![CDATA[
		
		<p>.net Compact Framework下的DataGrid来说，功能真的有限，不过想想也对，必竟Mobile设备的性能有限。如果对DataGrid有特殊需求的话，比方说要设置根据条件设置某行或某个单元格的字体、字体颜色、背景色等，那就只有自己想办法了，下面的代码是关于如何重新绘制单元格的样式，只要有行和列的序号就可以了。</p>
<p>&nbsp;&nbsp;  #region DrawGridCell</p>
<p>&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;returns&gt;&lt;/returns&gt;<br>
&nbsp;&nbsp;  public static int GetFirstVisibleRow(System.Windows.Forms.DataGrid grid)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  int result = 0;<br>
&nbsp;&nbsp;&nbsp;  try<br>
&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;  result = Convert.ToInt32(typeof(System.Windows.Forms.DataGrid).GetField(&quot;m_irowVisibleFirst&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  BindingFlags.NonPublic|BindingFlags.GetField<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  |BindingFlags.Instance).GetValue(grid));<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  catch<br>
&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  return result;<br>
}<br>
&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;irow&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;icol&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;font&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;foreColor&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;backColor&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,int irow,int icol,System.Drawing.Font font,System.Drawing.Color foreColor,System.Drawing.Color backColor)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  System.Drawing.Graphics g = grid.CreateGraphics();<br>
&nbsp;&nbsp;&nbsp;  System.Drawing.Rectangle rect = grid.GetCellBounds(irow,icol);<br>
&nbsp;&nbsp;&nbsp;  g.FillRectangle(new SolidBrush(backColor),rect);<br>
&nbsp;&nbsp;&nbsp;  g.DrawString(grid[irow,icol].ToString(),font,new SolidBrush(foreColor),rect);<br>
&nbsp;&nbsp;  }</p>
<p><br>
&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;irow&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;icol&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;font&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;foreColor&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,int irow,int icol,System.Drawing.Font font,System.Drawing.Color foreColor)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  DrawGridCell(grid,irow,icol,font,foreColor,grid.BackColor);<br>
&nbsp;&nbsp;  }</p>
<p><br>
&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;irow&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;icol&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;font&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,int irow,int icol,System.Drawing.Font font)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  DrawGridCell(grid,irow,icol,font,grid.ForeColor,grid.BackColor);<br>
&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;irow&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;icol&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,int irow,int icol)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  System.Drawing.Rectangle rect = grid.GetCellBounds(irow,icol);<br>
&nbsp;&nbsp;&nbsp;  grid.Invalidate(rect);<br>
&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;gridCell&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;font&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;foreColor&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;backColor&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,System.Windows.Forms.DataGridCell gridCell,System.Drawing.Font font,System.Drawing.Color foreColor,System.Drawing.Color backColor)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  DrawGridCell(grid,gridCell.RowNumber,gridCell.ColumnNumber,font,foreColor,backColor);<br>
&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;gridCell&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;font&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;foreColor&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,System.Windows.Forms.DataGridCell gridCell,System.Drawing.Font font,System.Drawing.Color foreColor)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  DrawGridCell(grid,gridCell.RowNumber,gridCell.ColumnNumber,font,foreColor,grid.BackColor);<br>
&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;gridCell&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;font&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,System.Windows.Forms.DataGridCell gridCell,System.Drawing.Font font)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  DrawGridCell(grid,gridCell.RowNumber,gridCell.ColumnNumber,font,grid.ForeColor,grid.BackColor);<br>
&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;grid&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  /// &lt;param name=&quot;gridCell&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;  public static void DrawGridCell(System.Windows.Forms.DataGrid grid,System.Windows.Forms.DataGridCell gridCell)<br>
&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;  DrawGridCell(grid,gridCell.RowNumber,gridCell.ColumnNumber);<br>
&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;  #endregion</p>
<p> </p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/Win%20Ce">Win Ce</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/4e1c45085453e2920a7b821f.html#comment">查看评论</a>]]></description>
        <pubDate>2009-02-27  14:13</pubDate>
        <category><![CDATA[Win Ce]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/4e1c45085453e2920a7b821f.html</guid>
</item>

<item>
        <title><![CDATA[在WinCe中判断进程是否已启动]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/ddee338795bec92dc75cc370.html]]></link>
        <description><![CDATA[
		
		<p>using System;<br>
using System.Collections.Generic;<br>
using System.Text;<br>
using System.Runtime.InteropServices;</p>
<p>namespace WindowsApplication1<br>
{<br>
&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;  /// MobileUtils<br>
&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;  public class MobileUtils<br>
&nbsp;&nbsp;&nbsp;  {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// 判断某个进程是否已经存在<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;param name=&quot;name&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;returns&gt;&lt;/returns&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public static bool IsProcessRunning(string processName)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  int hMutex;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  hMutex = CreateMutex(null, false, processName);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (GetLastError() == ERROR_ALREADY_EXISTS)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  ReleaseMutex(hMutex);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return true;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return false;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// GetLastError<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;returns&gt;&lt;/returns&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [DllImport(&quot;coredll.Dll&quot;)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private static extern int GetLastError();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// ReleaseMutex<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;param name=&quot;hMutex&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;returns&gt;&lt;/returns&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [DllImport(&quot;coredll.Dll&quot;)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private static extern int ReleaseMutex(int hMutex);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// CreateMutex<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;param name=&quot;lpMutexAttributes&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;param name=&quot;bInitialOwner&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;param name=&quot;lpName&quot;&gt;&lt;/param&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;returns&gt;&lt;/returns&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [DllImport(&quot;coredll.Dll&quot;)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private static extern int CreateMutex(SECURITY_ATTRIBUTES lpMutexAttributes, bool bInitialOwner, string lpName);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private const int ERROR_ALREADY_EXISTS = 0183;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// SECURITY_ATTRIBUTES<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  [StructLayout(LayoutKind.Sequential)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  private class SECURITY_ATTRIBUTES<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public int nLength;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public int lpSecurityDescriptor;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  /// &lt;/summary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  public int bInheritHandle;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
&nbsp;&nbsp;&nbsp;  }<br>
}</p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/Win%20Ce">Win Ce</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/ddee338795bec92dc75cc370.html#comment">查看评论</a>]]></description>
        <pubDate>2009-02-26  12:26</pubDate>
        <category><![CDATA[Win Ce]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/ddee338795bec92dc75cc370.html</guid>
</item>

<item>
        <title><![CDATA[使用C#实现将html转换成mht]]></title>
        <link><![CDATA[http://hi.baidu.com/flashdata/blog/item/cf293d9b70e3a7b2c9eaf49a.html]]></link>
        <description><![CDATA[
		
		<p> </p>
<p><span class="Apple-style-span" ><span class="Apple-style-span" style="word-spacing: 0px; font: 12px -webkit-monospace; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: pre; letter-spacing: normal; border-collapse: separate; text-align: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><span style="vertical-align: middle; color: rgb(0,0,0)">CDO.Message msg </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> CDO.MessageClass(); CDO.Configuration c </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> </span><span style="vertical-align: middle; color: rgb(0,0,255)">new</span><span style="vertical-align: middle; color: rgb(0,0,0)"> CDO.ConfigurationClass(); msg.Configuration </span><span style="vertical-align: middle; color: rgb(0,0,0)">=</span><span style="vertical-align: middle; color: rgb(0,0,0)"> c; msg.CreateMHTMLBody( </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">http://www.yesky.com</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">, CdoMHTMLFlags.cdoSuppressAll, </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">, </span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">); msg.GetStream().SaveToFile(</span><span style="vertical-align: middle; color: rgb(128,0,0)">@&quot;</span><span style="vertical-align: middle; color: rgb(128,0,0)">d:\1.mht</span><span style="vertical-align: middle; color: rgb(128,0,0)">&quot;</span><span style="vertical-align: middle; color: rgb(0,0,0)">, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);</span></span></span></p>
<p><span class="Apple-style-span" ><span class="Apple-style-span" style="word-spacing: 0px; font: 12px -webkit-monospace; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: pre; letter-spacing: normal; border-collapse: separate; text-align: left; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0"><span style="vertical-align: middle; color: rgb(0,0,0)"><span class="Apple-style-span" >CdoMHTMLFlags Enum  申明<span class="Apple-converted-space"> </span><br>
Name                    Value    Description <span class="Apple-converted-space"> </span><br>
CdoSuppressNone        0        Download all resources referred to in elements within the resource at the specified Uniform Resource Identifier (URI) (not recursive).<span class="Apple-converted-space"> </span><br>
<br>
CdoSuppressImages      1        Do not download resources referred to in IMG elements.<span class="Apple-converted-space"> </span><br>
CdoSuppressBGSounds    2        Do not download resources referred to in BGSOUND elements.<span class="Apple-converted-space"> </span><br>
CdoSuppressFrames      4        Do not download resources referred to in FRAME elements.<span class="Apple-converted-space"> </span><br>
CdoSuppressObjects      8        Do not download resources referred to in OBJECT elements.<span class="Apple-converted-space"> </span><br>
CdoSuppressStyleSheets  16      Do not download resources referred to in LINK elements.<span class="Apple-converted-space"> </span><br>
CdoSuppressAll          31      Do not download any resources referred to from within the page.<span class="Apple-converted-space"> </span></span></span></span></span></p> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/flashdata/blog/category/%2Enet%BF%AA%B7%A2">.net开发</a>&nbsp;<a href="http://hi.baidu.com/flashdata/blog/item/cf293d9b70e3a7b2c9eaf49a.html#comment">查看评论</a>]]></description>
        <pubDate>2009-02-26  11:38</pubDate>
        <category><![CDATA[.net开发]]></category>
        <author><![CDATA[hanfei8987]]></author>
		<guid>http://hi.baidu.com/flashdata/blog/item/cf293d9b70e3a7b2c9eaf49a.html</guid>
</item>


</channel>
</rss>