<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_随风飘扬_分类_[01] .NET</title><id>http://feed.cnblogs.com/blog/u/27725/category/125686/rss</id><updated>2012-06-04T05:31:10Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/category/125686.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/27725/category/125686/rss"/><entry><id>http://www.cnblogs.com/nicch/archive/2011/10/17/invalidcastexception_when_using_linq_cast.html</id><title type="text">LINQ中的强制类型转换Cast函数其实挺坑爹的</title><summary type="text">今天被LINQ的Cast函数坑了一次，不过细究之下其实还是学到了新东西的。其实强制类型转换大部分人都会天天接触，可是谁会知道这里面还有点小秘密呢？ 1.强制类型转换？ 我想能看到这里的同学应该都不需要我去解释，所谓强制类型转换就是指将一个变量由一个数据类型强制转换为另一个类型，当然前提是对象和目标类型是兼容的。 下面这两行便执行了一个强制类型转换： double a = 23.0; int b = (int)a; 由于过于简单，这里说太多就有失水准鸟。 不过呢，这里要求俩类型具有兼容性；所谓的兼容性就是说要么它们是派生类的关系，要么系统知道如何去转换他们...</summary><published>2011-10-17T15:13:00Z</published><updated>2011-10-17T15:13:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2011/10/17/invalidcastexception_when_using_linq_cast.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2011/10/17/invalidcastexception_when_using_linq_cast.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/nicch/archive/2011/02/14/simple_updater.html</id><title type="text">发布一个原创小类库：.Net 小型软件自动更新库（SimpAutoUpdater），已附上客户端+包生成工具源码</title><summary type="text">本类库+工具用于快速实现一个简单的自动更新程序，旨在快速简单地为现有的.Net应用程序添加上比较简单的自动更新功能。在发布应用程序时，我们经常会需要给自己的程序加上自动升级功能。.Net Framework自带的ClickOnce中有自动升级的功能，但是往往不太好用，比如必须用ClickOnce发布，安装的文件夹一个版本一个等等，我们会想要一个比较简单、甚至绿色软件也能使用的自动升级功能，这个自动...</summary><published>2011-02-14T15:17:00Z</published><updated>2011-02-14T15:17:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2011/02/14/simple_updater.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2011/02/14/simple_updater.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/nicch/archive/2011/01/08/1930875.html</id><title type="text">VS2010中WinForm中，&amp;ldquo;属性&amp;lt;属性名&amp;gt;的代码生成失败&amp;rdquo;的问题，熟悉WinForm组件开发的同学进来讨论下</title><summary type="text">UPDATED: 提供了可替换的解决方案，请参照本文末尾。   这是一个困扰我很久的问题，一直没有解决，搜索英文版的网站也没有能解决。姑且放在首页，用VS2010做过组件开发的同学进来讨论下。 简介：当一个在界面上提供扩展属性的组件（实现IExtenderProvider接口）使用项目引用或处在同一个项目里的时候，项目重编译后，组件上自定义的类别转换器将无法访问对应的类型，出现类型转换失败。 ...</summary><published>2011-01-08T12:16:00Z</published><updated>2011-01-08T12:16:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2011/01/08/1930875.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2011/01/08/1930875.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/nicch/archive/2010/05/25/building_cross_platform_application_on_64bit_msbuild.html</id><title type="text">64位系统上设置编译平台为x86的VS2008项目升级到VS2010后编译失败的原因和解决办法</title><summary type="text">在64bit系统上开发一些特定软件的时候，往往需要将目标平台由AnyCPU调整为x86（32位平台），比如当内嵌浏览器，或使用一些COM组件的时候。在VS2008中，直接新建一个解决方案平台会将解决方案中所有项目（包括可执行程序和库）全部调整为目标x86。当项目由vs2008升级到vs2010或特定的情况下，可能会发生编译失败的情况。比如当一个窗体上放有包含了图像的ImageList之后，ResG...</summary><published>2010-05-25T14:38:00Z</published><updated>2010-05-25T14:38:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2010/05/25/building_cross_platform_application_on_64bit_msbuild.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2010/05/25/building_cross_platform_application_on_64bit_msbuild.html"/><content type="text">在64bit系统上开发一些特定软件的时候，往往需要将目标平台由AnyCPU调整为x86（32位平台），比如当内嵌浏览器，或使用一些COM组件的时候。在VS2008中，直接新建一个解决方案平台会将解决方案中所有项目（包括可执行程序和库）全部调整为目标x86。当项目由vs2008升级到vs2010或特定的情况下，可能会发生编译失败的情况。比如当一个窗体上放有包含了图像的ImageList之后，ResG...</content></entry><entry><id>http://www.cnblogs.com/nicch/archive/2010/04/15/entityframework_with_old_db.html</id><title type="text">ADO.NET Entity Framework 运行在低版本 SQL Server上需要注意的两个问题</title><summary type="text">因为种种种种关系，开发用的数据库是Sql Server2008但是产品服务器是SQL Server2000，所以导致了问题的发生。问题一：存取包含“DateTime”数据类型的列时会引发异常异常信息：the version of SQL Server in use does not support datatype 'datetime2' 出现这个异常是因为SQL2008中...</summary><published>2010-04-15T14:20:00Z</published><updated>2010-04-15T14:20:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2010/04/15/entityframework_with_old_db.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2010/04/15/entityframework_with_old_db.html"/><content type="text">因为种种种种关系，开发用的数据库是Sql Server2008但是产品服务器是SQL Server2000，所以导致了问题的发生。问题一：存取包含“DateTime”数据类型的列时会引发异常异常信息：the version of SQL Server in use does not support datatype 'datetime2' 出现这个异常是因为SQL2008中...</content></entry><entry><id>http://www.cnblogs.com/nicch/archive/2009/07/19/1526618.html</id><title type="text">调用浏览器函数：WebBrowser.Document.InvokeScript 方法抛出&amp;ldquo;指定的转换无效&amp;rdquo;异常的原因</title><summary type="text">调用WebBrowser控件中的JS脚本使用这个函数来调用： WebBrowser.Document.InvokeScript("函数名",参数列表); 但是下午遇到一个很棘手的问题，就是调用的时候会抛出这样一个莫名其妙的异常： 未处理 System.InvalidCastException  Message="指定的转换无效。" &amp;#160...</summary><published>2009-07-19T10:03:00Z</published><updated>2009-07-19T10:03:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2009/07/19/1526618.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2009/07/19/1526618.html"/><content type="text">调用WebBrowser控件中的JS脚本使用这个函数来调用： WebBrowser.Document.InvokeScript("函数名",参数列表); 但是下午遇到一个很棘手的问题，就是调用的时候会抛出这样一个莫名其妙的异常： 未处理 System.InvalidCastException  Message="指定的转换无效。" &amp;#160...</content></entry><entry><id>http://www.cnblogs.com/nicch/archive/2009/06/07/1498214.html</id><title type="text">修改ListView：如何让ListView在显示复选框时双击行不改变复选框的选中状态</title><summary type="text">.Net中自带的ListView，在显示复选框的情况下，默认设置当你双击行时会改变复选框的选中状态。一般情况下这个动作没有任何问题，但是有些情况下我们不需要，例如，我们定义了双击行显示编辑对话框，那这...</summary><published>2009-06-07T11:32:00Z</published><updated>2009-06-07T11:32:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2009/06/07/1498214.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2009/06/07/1498214.html"/><content type="text">.Net中自带的ListView，在显示复选框的情况下，默认设置当你双击行时会改变复选框的选中状态。一般情况下这个动作没有任何问题，但是有些情况下我们不需要，例如，我们定义了双击行显示编辑对话框，那这...</content></entry><entry><id>http://www.cnblogs.com/nicch/archive/2009/04/05/serialize_object_ref.html</id><title type="text">如果解决在使用二进制序列化时对实体内其它对象的引用依赖</title><summary type="text">目前在做一个编辑器，编辑过程中有个保存编辑内容的实体类。因为内容比较复杂，为了防止意外的问题在保存的时候使用二进制序列化，但是这时就遇到一个问题，因为编辑需要这个实体类里面是有事件的，并且在编辑过程中这个事件已经被绑定到了用户控件。由于二进制序列化是精确还原对象的，所以尝试对这个实体类进行序列化的时候发生了问题：绑定了事件的用户控件是不可序列化的。实体类部分代码如下： 1: [Serializa...</summary><published>2009-04-05T11:26:00Z</published><updated>2009-04-05T11:26:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2009/04/05/serialize_object_ref.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2009/04/05/serialize_object_ref.html"/><content type="text">目前在做一个编辑器，编辑过程中有个保存编辑内容的实体类。因为内容比较复杂，为了防止意外的问题在保存的时候使用二进制序列化，但是这时就遇到一个问题，因为编辑需要这个实体类里面是有事件的，并且在编辑过程中这个事件已经被绑定到了用户控件。由于二进制序列化是精确还原对象的，所以尝试对这个实体类进行序列化的时候发生了问题：绑定了事件的用户控件是不可序列化的。实体类部分代码如下： 1: [Serializa...</content></entry><entry><id>http://www.cnblogs.com/nicch/archive/2009/03/12/vs_chs_under_en-us_os.html</id><title type="text">英文版系统上的中文VS2008菜单为英文以及打开会报告包加载错误的解决方法</title><summary type="text">（本文的系统为Windows7Beta版，对于其它的英文版OS应该也有用）早期的Windows7Beta版我用的是英文版加了中文包的，在它下面VS2008和SQL2008中文版的安装和使用都很正常，但是在那下面VS2008会出现问题，就是 Windows7 下的 VS2008 中LINQ设计界面鼠标移过数据表时表会消失 。那个下面没找到合适的解决办法，后来终于看到 7048 版的 WIndows7...</summary><published>2009-03-12T13:11:00Z</published><updated>2009-03-12T13:11:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2009/03/12/vs_chs_under_en-us_os.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2009/03/12/vs_chs_under_en-us_os.html"/><content type="text">（本文的系统为Windows7Beta版，对于其它的英文版OS应该也有用）早期的Windows7Beta版我用的是英文版加了中文包的，在它下面VS2008和SQL2008中文版的安装和使用都很正常，但是在那下面VS2008会出现问题，就是 Windows7 下的 VS2008 中LINQ设计界面鼠标移过数据表时表会消失 。那个下面没找到合适的解决办法，后来终于看到 7048 版的 WIndows7...</content></entry><entry><id>http://www.cnblogs.com/nicch/archive/2008/11/05/1326754.html</id><title type="text">打造出一个可自动调整大小的文字显示控件（Label）</title><summary type="text"/><published>2008-11-04T16:05:00Z</published><updated>2008-11-04T16:05:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2008/11/05/1326754.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2008/11/05/1326754.html"/><content type="text"/></entry><entry><id>http://www.cnblogs.com/nicch/archive/2008/04/17/WebDevServer_ExplorerMenuExt.html</id><title type="text">替文件夹加上“从此处开始运行测试服务器”的菜单</title><summary type="text">.NET 2.0 本身自带了一个 WebDevServer，所以开发调试简单了很多，至少不需要去折腾IIS了。平时从网上下载很多Demo的时候需要一个测试服务器，就可以用它来完成，也比用IIS省事许多。这个测试服务器位于 %systemroot%\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE，是命令行操作的，参数如下： WebDev.WebServer /port: /path: [/vpath:]但是私下里感觉用命令行操作太过麻烦，所以这次来在文件夹上面用批处理添加一个右键菜单。</summary><published>2008-04-17T04:57:00Z</published><updated>2008-04-17T04:57:00Z</updated><author><name>木鱼</name><uri>http://www.cnblogs.com/nicch/</uri></author><link rel="alternate" href="http://www.cnblogs.com/nicch/archive/2008/04/17/WebDevServer_ExplorerMenuExt.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/nicch/archive/2008/04/17/WebDevServer_ExplorerMenuExt.html"/><content type="text">.NET 2.0 本身自带了一个 WebDevServer，所以开发调试简单了很多，至少不需要去折腾IIS了。平时从网上下载很多Demo的时候需要一个测试服务器，就可以用它来完成，也比用IIS省事许多。这个测试服务器位于 %systemroot%\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE，是命令行操作的，参数如下： WebDev.WebServer /port: /path: [/vpath:]但是私下里感觉用命令行操作太过麻烦，所以这次来在文件夹上面用批处理添加一个右键菜单。</content></entry></feed>
