﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-天书的博客</title><link>http://www.cppblog.com/skybook/</link><description /><language>zh-cn</language><lastBuildDate>Wed, 08 Apr 2026 13:33:39 GMT</lastBuildDate><pubDate>Wed, 08 Apr 2026 13:33:39 GMT</pubDate><ttl>60</ttl><item><title>此方法显式使用的 CAS 策略已被 .NET Framework 弃用。若要出于兼容性原因而启用 CAS 策略，请使用 NetFx40_LegacySecurityPolicy 配置开关。</title><link>http://www.cppblog.com/skybook/archive/2013/11/01/204048.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Fri, 01 Nov 2013 09:28:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2013/11/01/204048.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/204048.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2013/11/01/204048.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/204048.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/204048.html</trackback:ping><description><![CDATA[&nbsp; 
<p style="font-size: 10.5pt; font-family: 宋体; margin: 0in">解决如下：</p>
<p style="font-size: 10.5pt; margin: 0in"><span style="font-family: Calibri">我的项目是应用程序，是在app.config&nbsp;</span><span style="font-family: 宋体">文件里面根节点加入：</span></p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&lt;runtime&gt;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;&nbsp;&nbsp;&nbsp;&lt;NetFx40_LegacySecurityPolicy&nbsp;enabled="true"/&gt;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;&nbsp;&lt;/runtime&gt;<br /><br />便可以顺利解决</p><img src ="http://www.cppblog.com/skybook/aggbug/204048.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2013-11-01 17:28 <a href="http://www.cppblog.com/skybook/archive/2013/11/01/204048.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>未在本地计算机注册"Microsoft.Jet.OLEDB.4.0"提供程序 及 for x86  System.Data.SQLite.dll插件解决</title><link>http://www.cppblog.com/skybook/archive/2013/11/01/204047.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Fri, 01 Nov 2013 09:28:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2013/11/01/204047.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/204047.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2013/11/01/204047.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/204047.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/204047.html</trackback:ping><description><![CDATA[&nbsp; 
<p style="font-size: 16pt; margin: 0in"><span lang="en-US" style="font-family: Calibri">1</span><span lang="zh-CN" style="font-family: 宋体">：Microsoft.Jet.OLEDB.4.0只支持</span><span lang="en-US" style="font-family: Calibri">32</span><span lang="zh-CN" style="font-family: 宋体">位操作系统，不支持</span><span lang="en-US" style="font-family: Calibri">64</span><span lang="zh-CN" style="font-family: 宋体">位操作系统，但是可以在</span><span lang="en-US" style="font-family: Calibri">64</span><span lang="zh-CN" style="font-family: 宋体">位操作系统中编译目标改为</span><span lang="en-US" style="font-family: Calibri">x86</span></p>
<p style="font-size: 10.5pt; margin: 0in"><span lang="en-US" style="font-family: Calibri">1:</span><span lang="zh-CN" style="font-family: 宋体">局数据系统由原来的</span><span lang="en-US" style="font-family: Calibri">.net2.0</span><span lang="zh-CN" style="font-family: 宋体">升级为</span><span lang="en-US" style="font-family: Calibri">.net4.0</span></p>
<p style="font-size: 10.5pt; margin: 0in"><span lang="en-US" style="font-family: Calibri">2:</span><span lang="zh-CN" style="font-family: 宋体">项目编译时的目标平台改为</span><span lang="en-US" style="font-family: Calibri">x86</span></p>
<p style="font-size: 10.5pt; margin: 0in"><span lang="en-US" style="font-family: Calibri">3:</span><span lang="zh-CN" style="font-family: Calibri">System.Data.SQLite.dll</span><span lang="zh-CN" style="font-family: 宋体">因为区分</span><span lang="en-US" style="font-family: Calibri">32<span style="mso-spacerun: yes">&nbsp; </span>64 </span><span lang="zh-CN" style="font-family: 宋体">位还有</span><span lang="en-US" style="font-family: Calibri">for x86</span><span lang="zh-CN" style="font-family: 宋体">的版本</span><span lang="en-US" style="font-family: Calibri"> </span><span lang="zh-CN" style="font-family: 宋体">目前用</span><span lang="en-US" style="font-family: Calibri">for x86</span><span lang="zh-CN" style="font-family: 宋体">版本</span><span lang="en-US" style="font-family: Calibri"> 1.0.76.0</span></p>
<p style="font-size: 10.5pt; margin: 0in"><span lang="en-US" style="font-family: Calibri">4</span><span lang="zh-CN" style="font-family: 宋体">：由此产生的问题：</span></p>
<p style="font-size: 10.5pt; color: red; margin: 0in"><span style="font-family: Calibri">此方法显式使用的&nbsp;CAS&nbsp;</span><span style="font-family: 宋体">策略已被</span><span style="font-family: Calibri">&nbsp;.NET&nbsp;Framework&nbsp;</span><span style="font-family: 宋体">弃用。若要出于兼容性原因而启用</span><span style="font-family: Calibri">&nbsp;CAS&nbsp;</span><span style="font-family: 宋体">策略，请使用</span><span style="font-family: Calibri">&nbsp;NetFx40_LegacySecurityPolicy&nbsp;</span><span style="font-family: 宋体">配置开关。</span></p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 8pt; color: #595959; margin: 0in"><span style="font-family: 宋体">源文档</span><span style="font-family: Calibri"> &lt;</span><a href="http://bbs.csdn.net/topics/370104103"><span style="font-family: Calibri">http://bbs.csdn.net/topics/370104103</span></a><span style="font-family: Calibri">&gt; </span></p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: 宋体; margin: 0in">解决如下：</p>
<p style="font-size: 10.5pt; margin: 0in"><span style="font-family: Calibri">我的项目是应用程序，首先是在app.config&nbsp;</span><span style="font-family: 宋体">文件里面根节点加入：</span></p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&lt;runtime&gt;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;&nbsp;&nbsp;&nbsp;&lt;NetFx40_LegacySecurityPolicy&nbsp;enabled="true"/&gt;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: Calibri; margin: 0in">&nbsp;&nbsp;&lt;/runtime&gt;</p>
<p style="font-size: 10.5pt; font-family: 宋体; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: 宋体; margin: 0in">&nbsp;</p>
<p style="font-size: 10.5pt; font-family: 宋体; margin: 0in">以上四个步骤便可解决问题</p><img src ="http://www.cppblog.com/skybook/aggbug/204047.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2013-11-01 17:28 <a href="http://www.cppblog.com/skybook/archive/2013/11/01/204047.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>silverlight 依赖性属性注册</title><link>http://www.cppblog.com/skybook/archive/2013/10/21/203852.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Mon, 21 Oct 2013 09:05:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2013/10/21/203852.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/203852.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2013/10/21/203852.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/203852.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/203852.html</trackback:ping><description><![CDATA[&nbsp;namespace OSSDOM.DataQuality.CommonSL.Control<br />{<br />&nbsp;&nbsp;&nbsp; public partial class SelectToMonth : UserControl<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region select title property<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static readonly DependencyProperty SelectTitleProperty =<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DependencyProperty.Register("SelectTitle", typeof(String), typeof(<span style="color: #ff0000">SelectToMonth</span>), null<span style="background-color: #99cc00">);//这块是类型</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string SelectTitle<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get { return (string)GetValue(SelectTitleProperty); }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set <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; SetValue(SelectTitleProperty, value); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #endregion<br /><br />
<p>&lt;UserControl x:Class="OSSDOM.DataQuality.CommonSL.Control.SelectToMonth"<br />&nbsp;&nbsp;&nbsp; xmlns="<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>"<br />&nbsp;&nbsp;&nbsp; xmlns:x="<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>"<br />&nbsp;&nbsp;&nbsp; xmlns:d="<a href="http://schemas.microsoft.com/expression/blend/2008">http://schemas.microsoft.com/expression/blend/2008</a>"<br />&nbsp;&nbsp;&nbsp; xmlns:mc="<a href="http://schemas.openxmlformats.org/markup-compatibility/2006">http://schemas.openxmlformats.org/markup-compatibility/2006</a>"<br />&nbsp;&nbsp;&nbsp; mc:Ignorable="d"<br />&nbsp;&nbsp;&nbsp; d:DesignHeight="27" d:DesignWidth="220" <span style="color: red">x:Name="userControl</span>"&gt;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &lt;Grid x:Name="LayoutRoot" Background="White"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Grid.ColumnDefinitions&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="60"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="63"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="15"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="64"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ColumnDefinition Width="15*"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Grid.ColumnDefinitions&gt;</p>
<p><span style="color: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TextBlock Height="20" Margin="2,3,1,0" Name="title" HorizontalAlignment="Stretch" VerticalAlignment="Top" </span><span style="color: #ff0000">Text="{Binding SelectTitle, ElementName=userControl}"</span><span style="">&nbsp; /&gt;</span>&nbsp;&nbsp; <span style="background-color: #99cc00">//这块是控件</span><span style="background-color: #99cc00">名称userControl<br /><br /><br /><br /></span><span style="">&nbsp;&lt;my:SelectToMonth Grid.Row="1" x:Name="结束时间" </span><span style="background-color: #ff6600">SelectTitle="结束时间" </span><span style="">/&gt;</span></p><img src ="http://www.cppblog.com/skybook/aggbug/203852.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2013-10-21 17:05 <a href="http://www.cppblog.com/skybook/archive/2013/10/21/203852.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C# winform DevExpress GridControl  GridView大批量数据（20万条）导出Excel</title><link>http://www.cppblog.com/skybook/archive/2013/10/12/203688.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Sat, 12 Oct 2013 07:29:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2013/10/12/203688.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/203688.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2013/10/12/203688.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/203688.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/203688.html</trackback:ping><description><![CDATA[DevExpress GridControl&nbsp; GridView大批量数据（20万条）导出Excel， 由于03版的Excel每个Sheet页只能承载65536条数据，故自带的ExportToExcelOld及ExportToPdf函数在导出20W条数据时，只能导出前65536条数据，其他数据丢失。 所以自己写导出函数，可以分sheet页来写，用到Excel组件，但是速度比较慢，现用数据流的方式来写，代码如下：
<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; width: 98%; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080">&nbsp;1</span><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">static</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;GridViewToExcel(Stream&nbsp;myStream,&nbsp;DevExpress.XtraGrid.Views.Grid.GridView&nbsp;dataGridView1)<br /></span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_115_1801_Open_Text.style.display='none'; Codehighlighter1_115_1801_Closed_Image.style.display='inline'; Codehighlighter1_115_1801_Closed_Text.style.display='inline';" id="Codehighlighter1_115_1801_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_115_1801_Closed_Text.style.display='none'; Codehighlighter1_115_1801_Open_Image.style.display='inline'; Codehighlighter1_115_1801_Open_Text.style.display='inline';" id="Codehighlighter1_115_1801_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_115_1801_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_115_1801_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StreamWriter&nbsp;sw&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;StreamWriter(myStream,&nbsp;System.Text.Encoding.GetEncoding(</span><span style="color: #000000">"</span><span style="color: #000000">gb2312</span><span style="color: #000000">"</span><span style="color: #000000">));<br /></span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;str&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">""</span><span style="color: #000000">;<br /></span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">try</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_276_1563_Open_Text.style.display='none'; Codehighlighter1_276_1563_Closed_Image.style.display='inline'; Codehighlighter1_276_1563_Closed_Text.style.display='inline';" id="Codehighlighter1_276_1563_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_276_1563_Closed_Text.style.display='none'; Codehighlighter1_276_1563_Open_Image.style.display='inline'; Codehighlighter1_276_1563_Open_Text.style.display='inline';" id="Codehighlighter1_276_1563_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_276_1563_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_276_1563_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">写标题&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000"><br /></span><span style="color: #008080">&nbsp;8</span><span style="color: #008000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">&nbsp;(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">;&nbsp;i&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">&nbsp;dataGridView1.Columns.Count;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /></span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_391_728_Open_Text.style.display='none'; Codehighlighter1_391_728_Closed_Image.style.display='inline'; Codehighlighter1_391_728_Closed_Text.style.display='inline';" id="Codehighlighter1_391_728_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_391_728_Closed_Text.style.display='none'; Codehighlighter1_391_728_Open_Image.style.display='inline'; Codehighlighter1_391_728_Open_Text.style.display='inline';" id="Codehighlighter1_391_728_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_391_728_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_391_728_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">10</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(</span><span style="color: #000000">!</span><span style="color: #0000ff">string</span><span style="color: #000000">.IsNullOrEmpty(dataGridView1.Columns[i].Caption))<br /></span><span style="color: #008080">11</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_494_710_Open_Text.style.display='none'; Codehighlighter1_494_710_Closed_Image.style.display='inline'; Codehighlighter1_494_710_Closed_Text.style.display='inline';" id="Codehighlighter1_494_710_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_494_710_Closed_Text.style.display='none'; Codehighlighter1_494_710_Open_Image.style.display='inline'; Codehighlighter1_494_710_Open_Text.style.display='inline';" id="Codehighlighter1_494_710_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_494_710_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_494_710_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">12</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(i&nbsp;</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">)<br /></span><span style="color: #008080">13</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_555_623_Open_Text.style.display='none'; Codehighlighter1_555_623_Closed_Image.style.display='inline'; Codehighlighter1_555_623_Closed_Text.style.display='inline';" id="Codehighlighter1_555_623_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_555_623_Closed_Text.style.display='none'; Codehighlighter1_555_623_Open_Image.style.display='inline'; Codehighlighter1_555_623_Open_Text.style.display='inline';" id="Codehighlighter1_555_623_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_555_623_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_555_623_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">14</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">\t</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">15</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">16</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;dataGridView1.Columns[i].Caption;<br /></span><span style="color: #008080">17</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">18</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">19</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" /><br /></span><span style="color: #008080">20</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sw.WriteLine(str);<br /></span><span style="color: #008080">21</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">写内容&nbsp;&nbsp;&nbsp;</span><span style="color: #008000"><br /></span><span style="color: #008080">22</span><span style="color: #008000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">&nbsp;(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;j&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;j&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">&nbsp;dataGridView1.RowCount;&nbsp;j</span><span style="color: #000000">++</span><span style="color: #000000">)<br /></span><span style="color: #008080">23</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_872_1487_Open_Text.style.display='none'; Codehighlighter1_872_1487_Closed_Image.style.display='inline'; Codehighlighter1_872_1487_Closed_Text.style.display='inline';" id="Codehighlighter1_872_1487_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_872_1487_Closed_Text.style.display='none'; Codehighlighter1_872_1487_Open_Image.style.display='inline'; Codehighlighter1_872_1487_Open_Text.style.display='inline';" id="Codehighlighter1_872_1487_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_872_1487_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_872_1487_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">24</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;tempStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">""</span><span style="color: #000000">;<br /></span><span style="color: #008080">25</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">&nbsp;(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;k&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">;&nbsp;k&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">&nbsp;dataGridView1.Columns.Count;&nbsp;k</span><span style="color: #000000">++</span><span style="color: #000000">)<br /></span><span style="color: #008080">26</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_1009_1426_Open_Text.style.display='none'; Codehighlighter1_1009_1426_Closed_Image.style.display='inline'; Codehighlighter1_1009_1426_Closed_Text.style.display='inline';" id="Codehighlighter1_1009_1426_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_1009_1426_Closed_Text.style.display='none'; Codehighlighter1_1009_1426_Open_Image.style.display='inline'; Codehighlighter1_1009_1426_Open_Text.style.display='inline';" id="Codehighlighter1_1009_1426_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1009_1426_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1009_1426_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">27</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(</span><span style="color: #000000">!</span><span style="color: #0000ff">string</span><span style="color: #000000">.IsNullOrEmpty(dataGridView1.Columns[k].Caption))<br /></span><span style="color: #008080">28</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_1120_1404_Open_Text.style.display='none'; Codehighlighter1_1120_1404_Closed_Image.style.display='inline'; Codehighlighter1_1120_1404_Closed_Text.style.display='inline';" id="Codehighlighter1_1120_1404_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_1120_1404_Closed_Text.style.display='none'; Codehighlighter1_1120_1404_Open_Image.style.display='inline'; Codehighlighter1_1120_1404_Open_Text.style.display='inline';" id="Codehighlighter1_1120_1404_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1120_1404_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1120_1404_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">29</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(k&nbsp;</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">)<br /></span><span style="color: #008080">30</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_1189_1269_Open_Text.style.display='none'; Codehighlighter1_1189_1269_Closed_Image.style.display='inline'; Codehighlighter1_1189_1269_Closed_Text.style.display='inline';" id="Codehighlighter1_1189_1269_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_1189_1269_Closed_Text.style.display='none'; Codehighlighter1_1189_1269_Open_Image.style.display='inline'; Codehighlighter1_1189_1269_Open_Text.style.display='inline';" id="Codehighlighter1_1189_1269_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1189_1269_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1189_1269_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">31</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempStr&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">\t</span><span style="color: #000000">"</span><span style="color: #000000">;<br /></span><span style="color: #008080">32</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">33</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tempStr&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;dataGridView1.GetRowCellValue(j,&nbsp;dataGridView1.Columns[k].FieldName);<br /></span><span style="color: #008080">34</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">35</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">36</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sw.WriteLine(tempStr);<br /></span><span style="color: #008080">37</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">38</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sw.Close();<br /></span><span style="color: #008080">39</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStream.Close();<br /></span><span style="color: #008080">40</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">41</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">catch</span><span style="color: #000000">&nbsp;(Exception&nbsp;ex)<br /></span><span style="color: #008080">42</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_1610_1672_Open_Text.style.display='none'; Codehighlighter1_1610_1672_Closed_Image.style.display='inline'; Codehighlighter1_1610_1672_Closed_Text.style.display='inline';" id="Codehighlighter1_1610_1672_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_1610_1672_Closed_Text.style.display='none'; Codehighlighter1_1610_1672_Open_Image.style.display='inline'; Codehighlighter1_1610_1672_Open_Text.style.display='inline';" id="Codehighlighter1_1610_1672_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1610_1672_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1610_1672_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">43</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show(ex.ToString());<br /></span><span style="color: #008080">44</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">45</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">finally</span><span style="color: #000000"><br /></span><span style="color: #008080">46</span><span style="color: #000000"><img onclick="this.style.display='none'; Codehighlighter1_1706_1782_Open_Text.style.display='none'; Codehighlighter1_1706_1782_Closed_Image.style.display='inline'; Codehighlighter1_1706_1782_Closed_Text.style.display='inline';" id="Codehighlighter1_1706_1782_Open_Image" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img onclick="this.style.display='none'; Codehighlighter1_1706_1782_Closed_Text.style.display='none'; Codehighlighter1_1706_1782_Open_Image.style.display='inline'; Codehighlighter1_1706_1782_Open_Text.style.display='inline';" id="Codehighlighter1_1706_1782_Closed_Image" style="display: none" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1706_1782_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1706_1782_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">47</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sw.Close();<br /></span><span style="color: #008080">48</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myStream.Close();<br /></span><span style="color: #008080">49</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">50</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080">51</span><span style="color: #000000"><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div><br /><img src ="http://www.cppblog.com/skybook/aggbug/203688.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2013-10-12 15:29 <a href="http://www.cppblog.com/skybook/archive/2013/10/12/203688.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>dataPager大数据量数据绑定呈现时，根据分页号索引动态加载数据源</title><link>http://www.cppblog.com/skybook/archive/2013/04/15/199457.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Mon, 15 Apr 2013 07:35:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2013/04/15/199457.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/199457.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2013/04/15/199457.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/199457.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/199457.html</trackback:ping><description><![CDATA[<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">private void MakePager_BigData()</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">{</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">try</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">{</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt"></p>
<p style="margin: 0in; font-size: 10.5pt"><span style="font-family: Calibri">var itemCount = new List&lt;int&gt;();</span><span style="font-family: Calibri">//</span><span style="font-family: SimSun">数据源总共多少数据的整形链表</span></p>
<p style="margin: 0in; font-size: 10.5pt"><span style="font-family: Calibri">int pageCount = IDList.Count / dataGridPageSize;</span><span style="font-family: Calibri"> //</span><span style="font-family: SimSun">计算出总共多少页</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">//</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">for (int i = 0; i &lt; pageCount; i++)</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">{</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">itemCount.Add(i);</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">}</p>
<p style="margin: 0in; font-size: 10.5pt"><span style="font-family: Calibri">PagedCollectionView pcv = new PagedCollectionView(itemCount);</span><span style="font-family: Calibri">//</span><span style="font-family: SimSun">创建</span><span style="font-family: Calibri">PagedCollectionView</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">if (pcv != null)</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">{</p>
<p style="margin: 0in; font-size: 10.5pt"><span style="font-family: Calibri"></span><span style="background-color: #ff9900; font-family: Calibri">pcv.PageSize = 1;</span><span style="background-color: #ff9900; font-family: Calibri">//</span><span style="background-color: #ff9900; font-family: SimSun">设置</span><span style="background-color: #ff9900; font-family: Calibri">PagedCollectionView</span><span style="background-color: #ff9900; font-family: SimSun">的每页显示</span><span style="background-color: #ff9900; font-family: Calibri">1</span><span style="background-color: #ff9900; font-family: SimSun">条数据（虚拟对应的，为了和</span><span style="background-color: #ff9900; font-family: Calibri">datagrid</span><span style="background-color: #ff9900; font-family: SimSun">对应）</span></p>
<p style="margin: 0in; font-size: 10.5pt"><span style="background-color: #ff9900; font-family: Calibri">dataPager1.PageSize = 1;</span><span style="background-color: #ff9900; font-family: Calibri">//</span><span style="background-color: #ff9900; font-family: SimSun">设置</span><span style="background-color: #ff9900; font-family: Calibri">dataPager</span><span style="background-color: #ff9900; font-family: SimSun">每页显示</span><span style="background-color: #ff9900; font-family: Calibri">1</span><span style="background-color: #ff9900; font-family: SimSun">条数据（虚拟对应的，为了和</span><span style="background-color: #ff9900; font-family: Calibri">datagrid</span><span style="background-color: #ff9900; font-family: SimSun">对应）</span></p>
<p style="margin: 0in; font-size: 10.5pt"><span style="font-family: Calibri"></span><span style="background-color: #33cccc; font-family: Calibri">this.dataPager1.Source = pcv;</span><span style="background-color: #33cccc; font-family: Calibri">//</span><span style="background-color: #33cccc; font-family: SimSun">设置</span><span style="background-color: #33cccc; font-family: Calibri">dataPager</span><span style="background-color: #33cccc; font-family: SimSun">的数据源</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">}</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt"></p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">}</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); }</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">}</p>
<p style="margin: 0in; font-size: 10.5pt"><span style="font-family: Calibri">//</span><span style="font-family: SimSun">根据页索引动态绑定数据源</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">private void dataPager1_PageIndexChanged(object sender, EventArgs e)</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">{</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">int curPageIdx = dataPager1.PageIndex;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">int skipData = curPageIdx * dataGridPageSize;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">List&lt;IDData&gt; curBindingDataSource = ((from p in IDList select p).Skip(skipData).Take(dataGridPageSize)).ToList();</p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt"><span style="background-color: yellow">dataGrid1.ItemsSource = curBindingDataSource;</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 10.5pt">}</p><img src ="http://www.cppblog.com/skybook/aggbug/199457.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2013-04-15 15:35 <a href="http://www.cppblog.com/skybook/archive/2013/04/15/199457.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>silverlight4.0 DataGrid 设置改变单元格颜色，根据值设置不同的颜色</title><link>http://www.cppblog.com/skybook/archive/2010/12/07/135711.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Tue, 07 Dec 2010 08:17:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2010/12/07/135711.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/135711.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2010/12/07/135711.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/135711.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/135711.html</trackback:ping><description><![CDATA[
<img src="http://www.cppblog.com/images/cppblog_com/skybook/DataGridCellColor.jpg" id="" width="482" height="179" vspace="0" hspace="0" border="" align="baseline" alt="" longdesc=""><div>运行效果见上图， 可以根据单元格中的值来设置颜色，100%为红色，其他为绿色。</div><div>实现方法：用列模板绑定数据源中定义的颜色数据项。</div><div>其中列模板用Border加TextBox构成，代码如下：</div><div><div>private static DataTemplate MakeCellTemplate(MyColumn col)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataTemplate dt1 = new DataTemplate();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;StringBuilder xaml = new StringBuilder();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("&lt;DataTemplate ");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("xmlns='http://schemas.microsoft.com/client/2007' ");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' ");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("&gt;");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("&lt;Border ");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("BorderThickness='0.5' BorderBrush='LightGray' Background='Orange'&gt;");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("&lt;TextBox ");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("IsReadOnly='True' Text='{Binding " + col.Name + "}' Foreground='Black' BorderBrush='White' BorderThickness='0' Background='{Binding " + col.colorValue + "}'");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("/&gt;");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("&lt;/Border&gt;");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xaml.Append("&lt;/DataTemplate&gt;");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dt1 = (DataTemplate)XamlReader.Load(xaml.ToString());</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return dt1;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception ex)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message + ex.StackTrace);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return null;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><img src ="http://www.cppblog.com/skybook/aggbug/135711.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2010-12-07 16:17 <a href="http://www.cppblog.com/skybook/archive/2010/12/07/135711.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>gsoap 生成webservice服务端框架(c++)步骤</title><link>http://www.cppblog.com/skybook/archive/2010/11/23/134420.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Tue, 23 Nov 2010 12:16:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2010/11/23/134420.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/134420.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2010/11/23/134420.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/134420.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/134420.html</trackback:ping><description><![CDATA[<div>1：首先到gsoap-2.7\gsoap\bin\win32 目录下面： 包括两个文件wsdl2h.exe 和&nbsp;</div><div>soapcpp2.exe。 把生成好的wsdl文件也拷贝到这个目录下面。</div><div></div><div>2：wsdl2h.exe -h看帮助文件， 其中参数-c是生成C语言的， 不加参数-c代表C++</div><div>的， -s代表不用STL（有时有这个标准模板库编译不过去），一般我们用参数-s</div><div>"wsdl2h -s Test.wsdl"<br />详细网址（http://wenku.baidu.com/view/68e0fb1252d380eb62946d8e.html &nbsp;或者<div><div></div></div>http://wenku.baidu.com/view/ebdd3f29bd64783e09122b7a.html?from=rec&amp;pos=0&amp;weight=30&amp;lastweight=9&amp;count=5）</div><div></div><div>3:soapcpp2 -h 查看帮助</div><div>4：soapcpp2 -S -L -i Test.h生成.cpp文件<br />-C &nbsp;代表生成客户端代码<br />-S &nbsp;代表生成服务端代码<br />-L &nbsp;代表不生成soapClientLib/soapServiceLib<br />-c &nbsp;代表仅生成c代码<br />-i &nbsp; 代表使用proxy<br />通常情况下使用命令 soapcpp2 -S/-C -L -i xxx.h<br /></div><div></div><div>5：最后生成的.h .cpp .xml文件中只需要保留下面五个即可</div><div>soapC.cpp &nbsp;</div><div>soapH.h&nbsp;</div><div>soapService1SoapService.cpp&nbsp;</div><div>soapServiceSoapService.h&nbsp;</div><div>soapStub.h</div><img src ="http://www.cppblog.com/skybook/aggbug/134420.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2010-11-23 20:16 <a href="http://www.cppblog.com/skybook/archive/2010/11/23/134420.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>c#插件间调用(反射)</title><link>http://www.cppblog.com/skybook/archive/2010/10/26/131300.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Tue, 26 Oct 2010 01:13:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2010/10/26/131300.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/131300.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2010/10/26/131300.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/131300.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/131300.html</trackback:ping><description><![CDATA[<div><br></div><div>&nbsp;&nbsp; &nbsp; IPluginService myPluginService = (IPluginService)this.application.GetService(typeof(IPluginService));</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IConfigManageService ConfigService = (IConfigManageService)this.application.GetService(typeof(IConfigManageService));</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PluginInfo myPlugin = ConfigService.getPluginInfoByClassType("Inspur.CM.NeGroup");</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;myPlugin.MethodName = "setConfig";</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;myPlugin = myPluginService.getPluginByName(myPlugin);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;myPlugin.doInvoke(strValue);</div>
<img src ="http://www.cppblog.com/skybook/aggbug/131300.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2010-10-26 09:13 <a href="http://www.cppblog.com/skybook/archive/2010/10/26/131300.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>屏幕右下角坐标获取</title><link>http://www.cppblog.com/skybook/archive/2010/10/25/131148.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Mon, 25 Oct 2010 01:57:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2010/10/25/131148.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/131148.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2010/10/25/131148.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/131148.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/131148.html</trackback:ping><description><![CDATA[<div>&nbsp;System.Drawing.Rectangle r = System.Windows.Forms.Screen.GetWorkingArea(recForm);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;recForm.Location = new System.Drawing.Point(r.Right - recForm.Width, r.Bottom - recForm.Height);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;recForm.Show();</div>
<img src ="http://www.cppblog.com/skybook/aggbug/131148.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2010-10-25 09:57 <a href="http://www.cppblog.com/skybook/archive/2010/10/25/131148.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DevExpress TreeList 调优_绑定数据源方式, 放弃原来的AppendNode加载数据的方式</title><link>http://www.cppblog.com/skybook/archive/2010/08/18/123807.html</link><dc:creator>天书</dc:creator><author>天书</author><pubDate>Wed, 18 Aug 2010 02:56:00 GMT</pubDate><guid>http://www.cppblog.com/skybook/archive/2010/08/18/123807.html</guid><wfw:comment>http://www.cppblog.com/skybook/comments/123807.html</wfw:comment><comments>http://www.cppblog.com/skybook/archive/2010/08/18/123807.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/skybook/comments/commentRss/123807.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/skybook/services/trackbacks/123807.html</trackback:ping><description><![CDATA[


DevExpress TreeList加载大批量数据的时候绑定数据源 dataTable.<div>注意事项1： 由于一旦绑定了数据源dataTable的些许变化便在TreeList中有所体现, 所以等dataTable完全填充好了之后再绑定数据源.</div><div>注意事项2：dataTable每行的父节点ID当加载到目前为止,还没有找到那么可能就当成空了, 所以最后treelist呈现就有问题, 所以解决办法有3个, 1： 大范围数据,也就是父节点的数据一定要先于子节点在表中排列.(这个不好控制). &nbsp;2： 等完全填充完datatable时再重新设置每行的父节点ID. &nbsp; <strong>3：可以边填充边设置, 最后再绑定数据源, 在填充dataTable之前先解绑数据源, 即先把数据源设为空,完全填充好再重新绑定(经过测试这种方法的加载速度最快了)</strong></div><div>参看代码如下:</div><div><div>public void ShowData(ForecastService.TrafficResult[] result, int iscrop, bool AllType)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//填充数据</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResetCtrl(AllType);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.result = result;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;treeListResult.Nodes.Clear();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong>treeListResult.DataSource = null; //一定要先解绑</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FillTypeFirstData(result, this.dtResult);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong>treeListResult.DataSource = dtResult;</strong></div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (treeListResult.Nodes.Count &gt; 0)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (int i = 0; i &lt; treeListResult.Nodes.Count; i++)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;treeListResult.Nodes[i].HasChildren = true;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;treeListResult.Nodes[i].Expanded = true;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception ex)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message + ex.StackTrace);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><div><div>private void FillTypeFirstData(Inspur.Forecast.ForecastService.TrafficResult[] result, DataTable dataTable)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataTable.Rows.Clear();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (int i = 0; i &lt; result.Length; i++)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (result[i].trafficType == "ALL" &amp;&amp; result[i].city == "ALL")//全省的数据</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataRow dr = dataTable.NewRow();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong> &nbsp;dr["keyFieldName"] = "湖南";//设置当前行ID</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&nbsp;dr["parentFieldName"] = DBNull.Value; &nbsp;//设置父节点ID</strong></div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["维度"] = "湖南";</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年基准日话务量"] = result[i].lastFir.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年预测日话务量"] = result[i].lastSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["增长幅度"] = result[i].add.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年基准日话务量"] = result[i].nowFir.Trim();</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年预测日话务量"] = result[i].nowSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["目前电路数"] = result[i].count.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["预测2M电路数"] = result[i].fcastcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["需要新增的电路数"] = result[i].addcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataTable.Rows.Add(dr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (result[i].trafficType != "ALL" &amp;&amp; result[i].city == "ALL" &amp;&amp; result[i].nename == "ALL")//汇总到类型的数据</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataRow dr = dataTable.NewRow();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["keyFieldName"] = result[i].trafficType;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["parentFieldName"] = "湖南";</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["维度"] = result[i].trafficType;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年基准日话务量"] = result[i].lastFir.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年预测日话务量"] = result[i].lastSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["增长幅度"] = result[i].add.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年基准日话务量"] = result[i].nowFir.Trim();</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年预测日话务量"] = result[i].nowSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["目前电路数"] = result[i].count.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["预测2M电路数"] = result[i].fcastcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["需要新增的电路数"] = result[i].addcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataTable.Rows.Add(dr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (result[i].trafficType != "ALL" &amp;&amp; result[i].city != "ALL" &amp;&amp; result[i].nename == "ALL")//汇总到地市的数据</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataRow dr = dataTable.NewRow();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["keyFieldName"] = result[i].trafficType + "_" + result[i].city;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["parentFieldName"] = result[i].trafficType;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["维度"] = result[i].city;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年基准日话务量"] = result[i].lastFir.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年预测日话务量"] = result[i].lastSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["增长幅度"] = result[i].add.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年基准日话务量"] = result[i].nowFir.Trim();</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年预测日话务量"] = result[i].nowSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["目前电路数"] = result[i].count.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["预测2M电路数"] = result[i].fcastcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["需要新增的电路数"] = result[i].addcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataTable.Rows.Add(dr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (result[i].trafficType != "ALL" &amp;&amp; result[i].city != "ALL" &amp;&amp; result[i].nename != "ALL" &amp;&amp; result[i].middle == "ALL")//汇总到网元的数据</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataRow dr = dataTable.NewRow();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["keyFieldName"] = result[i].trafficType + "_" + result[i].city + "_" + result[i].nename;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["parentFieldName"] = result[i].trafficType + "_" + result[i].city;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["维度"] = result[i].nename;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年基准日话务量"] = result[i].lastFir.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年预测日话务量"] = result[i].lastSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["增长幅度"] = result[i].add.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年基准日话务量"] = result[i].nowFir.Trim();</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年预测日话务量"] = result[i].nowSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["目前电路数"] = result[i].count.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["预测2M电路数"] = result[i].fcastcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["需要新增的电路数"] = result[i].addcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataTable.Rows.Add(dr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else if (result[i].trafficType != "ALL" &amp;&amp; result[i].city != "ALL" &amp;&amp; result[i].nename != "ALL" &amp;&amp; result[i].middle != "ALL")//到中继的数据</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataRow dr = dataTable.NewRow();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["keyFieldName"] = result[i].trafficType + "_" + result[i].city + "_" + result[i].nename + "_" + result[i].middle;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["parentFieldName"] = result[i].trafficType + "_" + result[i].city + "_" + result[i].nename;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["维度"] = result[i].middle;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年基准日话务量"] = result[i].lastFir.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["去年预测日话务量"] = result[i].lastSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["增长幅度"] = result[i].add.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年基准日话务量"] = result[i].nowFir.Trim();</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["今年预测日话务量"] = result[i].nowSec.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["目前电路数"] = result[i].count.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["预测2M电路数"] = result[i].fcastcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dr["需要新增的电路数"] = result[i].addcount.Trim();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dataTable.Rows.Add(dr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception ex)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message + ex.StackTrace);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><div><div>public TrafficResultTree(IApplication application)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InitializeComponent();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.application = application;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SetTreeListColumn("Config\\Forecast\\TrafficForecastResultTree.xml", "/Head", treeListResult);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//Test</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PublicFunction.SetDataTableColumn(treeListResult, dtResult);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&nbsp;treeListResult.ParentFieldName = "parentFieldName"; &nbsp;//设置树的</strong><strong>ParentFieldName 属性</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&nbsp;treeListResult.KeyFieldName = "keyFieldName"; &nbsp;//设置树的</strong><strong>KeyFieldName 属性</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><div><div>public static void SetDataTableColumn(DevExpress.XtraTreeList.TreeList treeListResult, DataTable dtResult)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dtResult.Columns.Clear();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong>DataColumn dcid = new DataColumn("keyFieldName", Type.GetType("System.String"));</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong>DataColumn dcparentId = new DataColumn("parentFieldName", Type.GetType("System.String"));</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dtResult.Columns.Add(dcid);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dtResult.Columns.Add(dcparentId);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for (int i = 0; i &lt; treeListResult.Columns.Count; i++)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataColumn dc = new DataColumn(treeListResult.Columns[i].FieldName);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dtResult.Columns.Add(dc);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception ex)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message + ex.StackTrace);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><div><br></div><div><div>private void InsertRelayData(string time, string type, string cityName, string equipeName, string burName, Inspur.Analysis.AnalysisService.Relay resultRelay)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataRow drRelay = dtResult.NewRow();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["keyFieldName"] = time + "_" + type + "_" + cityName + "_" + equipeName + "_" + burName + "_" + resultRelay.RelayName + "_" + DateTime.Now.ToString(); <strong>&nbsp;</strong></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["parentFieldName"] = time + "_" + type + "_" + cityName + "_" + equipeName + "_" + burName;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["维度"] = resultRelay.RelayName;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["定义电路数"] = resultRelay.Total.CIRCUITS;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["来话试呼次数"] = resultRelay.Total.in_att;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["去话试呼次数"] = resultRelay.Total.out_att;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["来话应答次数"] = resultRelay.Total.in_ans;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["去话应答次数"] = resultRelay.Total.out_ans;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["来话话务量"] = resultRelay.Total.in_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["去话话务量"] = resultRelay.Total.out_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["总话务量"] = resultRelay.Total.traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["来话市话话务量"] = resultRelay.Total.in_local_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["去话市话话务量"] = resultRelay.Total.out_local_traf;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["来话长话话务量"] = resultRelay.Total.in_long_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["去话长话话务量"] = resultRelay.Total.out_long_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["市话话务量"] = resultRelay.Total.local_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;drRelay["长话话务量"] = resultRelay.Total.long_traf;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dtResult.Rows.Add(drRelay);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//DevExpress.XtraTreeList.Nodes.TreeListNode noderelay = null;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//for (int i = 0; i &lt; nodebureauD.Nodes.Count; i++)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;if (nodebureauD.Nodes[i]["维度"].ToString() == relay.RelayName)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp; &nbsp; &nbsp;noderelay = nodebureauD.Nodes[i];</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//if (noderelay == null)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;List&lt;string&gt; relayList = new List&lt;string&gt;();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;relayList.Add(relay.RelayName);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;noderelay = treeList.AppendNode(relayList.ToArray(), nodebureauD);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//if (noderelay != null)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp;InsertTargetData(noderelay, relay.RelayName, relay.Total);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (Exception ex)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MessageBox.Show(ex.Message + ex.StackTrace);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></div><div><br></div><img src ="http://www.cppblog.com/skybook/aggbug/123807.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/skybook/" target="_blank">天书</a> 2010-08-18 10:56 <a href="http://www.cppblog.com/skybook/archive/2010/08/18/123807.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>