跟小D每日学口语

随笔分类 -  CSharp Technical

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页
CSharp Technical
摘要:第一部:进入static void Main()第二部:运行static void Main() 中的Application.Run(new Form1());在这中间对窗体进行构造。 2.1 执行private System.ComponentModel.Container components = null;作用是Container 类是IContainer 接口的默认实现。容器是封装和跟踪零个或更多个组件的对象。在此上下文中,包容是指逻辑包荣, 而不是直观包容。可以在多种方案下使用组件和容器,包括可视化方案和非可视化方案。在一个先入先出列表中跟踪容器中的组件,该列表也定义了容器内组件的顺 阅读全文
posted @ 2012-04-10 09:51 Danny Chen 阅读(962) 评论(0) 推荐(0)
摘要:在网上找了下插件式编程的资料,这里自己先借鉴下别人的,同时发现有自己的看法,不过由于本人水平有限,不一定有参考价值,写出来一方面是为了总结自己,以求提高,另一方面也希望各为朋友看到我的不足,给我提出宝贵意见。什么是插件式编程提起插件式,我们首先想到的是firefox,用过firefox的人都知道它是一个插件式程序。当一个功能需要,完全可以从网上下载一个插件后,重启后,就能使用。这个功能给我们带来许多的方便之处,这就是插件式程序的好处。插件的本质在于不修改程序主体(平台)的情况下对软件功能进行拓展与加强,当插件的接口公开后,任何公司或个人都可以制作自己的插件来解决一些操作上的不便或增加新功能,也 阅读全文
posted @ 2012-04-09 09:44 Danny Chen 阅读(425) 评论(0) 推荐(0)
摘要:在.Net Framework中,在System.Xml类库中,查找一个Xml节点的最简单方法是通过XmlNode.SelectSingleNode和XmlNode.SelectNodes方法,解析XPath字符串。不过如果Xml文本中包含名称空间(Namespace),事情就有一点点复杂了。注意,Xml名称空间属于亦正亦邪的技术,参见Xml名称空间(Namespace)的简介和优劣分析。含有名称空间(Namespace)前缀的Xml比如以下的例子,xdoc.SelectSingleNode什么也找不到,只能得到Nothing。Dim xml As String = "<tes 阅读全文
posted @ 2012-04-09 09:20 Danny Chen 阅读(1123) 评论(0) 推荐(0)
摘要:This example shows how to dynamically load assembly, how to create object instance, how to invoke method or how to get and set propertyvalue.Create instance from assembly that is in your project ReferencesThe following examples create instances of DateTime class from the System assembly.[C#]// creat 阅读全文
posted @ 2012-04-07 16:34 Danny Chen 阅读(512) 评论(0) 推荐(0)
摘要:This example shows how to get all culture names in the .NET Framework. Use static methodCultureInfo.Get­Cultures. To get associated specific culture use static methodCultureInfo.Cre­ateSpecificCul­ture.Following code is modified MSDN example (it'sjust sorted by culturename).[C#]// 阅读全文
posted @ 2012-04-07 16:32 Danny Chen 阅读(317) 评论(0) 推荐(0)
摘要:http://stackoverflow.com/questions/4197923/xml-document-set-attribute-question 阅读全文
posted @ 2012-04-07 16:30 Danny Chen 阅读(124) 评论(0) 推荐(0)
摘要:This example shows how to select nodes from XML documentby attribute value. Use methodXmlNode.Selec­tNodesto get list of nodes selected by the XPath expression. Suppose we have this XMLfile.[XML]<Names> <Name type="M">John</Name> <Name type="F">Susan& 阅读全文
posted @ 2012-04-07 16:29 Danny Chen 阅读(382) 评论(0) 推荐(0)
摘要:you have to use XmlBuilder object to build XML file/stringe.g./////XML<?xml version="1.0" encoding="utf-8"?><children> <!--Children below...--> <child age="1" referenceNumber="ref-1">child &amp; content #1</child> <child ag 阅读全文
posted @ 2012-04-07 16:28 Danny Chen 阅读(241) 评论(0) 推荐(0)
摘要:XML Schema是以XML语言为基础的,它用于可替代DTD。 一份XML schema文件描述了XML文档的结构。 XML Schema语言也被称为XML Schema Definition (XSD)(XML Schema定义). 1.什么是XML Schema? XML Schema的作用是定义一份XML文档的合法组件群,就像DTD的作用一样,一份XML Schema: 定义了可以出现在文档里的元素 定义了可以出现在文档里的属性 定义了哪些元素是子元素 定义了子元素的顺序 定义了子元素的数量 定义了一个元素应是否能包含文本,或应该是空的... 阅读全文
posted @ 2012-04-03 09:54 Danny Chen 阅读(609) 评论(0) 推荐(0)
摘要:The csproj files are in fact MSBuild files. The xsd for those can be found here:%windir%\Microsoft.NET\Framework\[framework version]\Microsoft.Build.xsd 阅读全文
posted @ 2012-04-01 12:52 Danny Chen 阅读(191) 评论(0) 推荐(0)
摘要:Question : Whilst investigating a memory leak I discovered that it was caused by calling NewRow() on a Table inside a loop many times. However the DataRow created was never added to the Table Rows collection and the Table Rows Count never got above zero.My question is why does this use up more memor 阅读全文
posted @ 2012-03-31 18:57 Danny Chen 阅读(319) 评论(0) 推荐(0)
摘要:摘要:有时候我们的数据存放在Excel中(特别是对于用户来说更喜欢使用Excel收集一些常用数据),而系统又需要这些数据来处理其他业务,那么此时我们就需要将这些数据导入到数据库中。但是鉴于Excel的样式多种多样,因此每次导入时都必须书写很多重复的代码。很明显对于一个软件开发者做这些重复劳动是一件很无趣的事情。那么怎样来寻中一种通用的方法呢?今天我们就一块看一下如何来解决这个问题。 主要内容 Excel操作组件的选择 总体设计思路 配置文件设计 类设计 编码实现 一点补充 简单的测试 总结 一、Excel操作组件的选择 在开始今天的主题之前我们先简单的看一个基础的问题,那就是如何进行Excel 阅读全文
posted @ 2012-03-29 14:33 Danny Chen 阅读(666) 评论(2) 推荐(0)
摘要:Add [CLSCompliant(false)] attribute for class.It's means don't need to do CLS check for another language(VB.NET,F#) but C#. 阅读全文
posted @ 2012-03-29 09:49 Danny Chen 阅读(395) 评论(0) 推荐(0)
摘要:public访问不受限制。protected访问仅限于包含类或从包含类派生的类型。internal访问仅限于当前项目。protectedinternal访问仅限于从包含类派生的当前项目或类型。private访问仅限于包含类型。引用自:http://ajunsj.blog.163.com/blog/static/1067534200854113951124/ 阅读全文
posted @ 2012-03-28 15:25 Danny Chen 阅读(323) 评论(0) 推荐(0)
摘要:原文地址:http://hi.baidu.com/kjkj911/blog/item/0ecc3ec7855dd6d4d100600f.htmlprivate _Workbook _workBook = null;private Worksheet _workSheet = null;private Excel.Application _excelApplicatin = null;_excelApplicatin = new Excel.Application();_excelApplicatin.Visible = true;_excelApplicatin.DisplayAlerts = 阅读全文
posted @ 2012-03-26 17:09 Danny Chen 阅读(278) 评论(0) 推荐(0)
摘要:http://msdn.microsoft.com/en-us/library/ms247123(v=vs.80).aspxWay 1: Use sn commandsn /R D:\EK.Capture.DR.Gui.CCLongLengthManipulator.dll D:\Project\V5\DR\dr_v5_sdc_dev\DR\EK\Capture\DR\Common\FullKey.snkWay 2: create bat file to run as below:"C:\program files\microsoft visual studio 8\sdk\v2.0 阅读全文
posted @ 2012-03-26 09:40 Danny Chen 阅读(200) 评论(0) 推荐(0)
摘要:1、DataTable不支持线程安全,如果有多个线程同时更新DataTable中不同行时必须使用Lock(dataTable)锁定,保证线程安全2、多线程都要更新全局变量时必须使用Lock(变量)锁定,防止变量值错误3、线程执行完线程方法会自动结束,也可以线程方法中用Thread.CurrentThread.Abort();强行线程结束4、线程方法中的局部变量是不会相互影响5、如果一方法需要在多线程中只能同一时间一个线程访问,则使用Lock(this)实现 阅读全文
posted @ 2012-03-18 00:26 Danny Chen 阅读(360) 评论(0) 推荐(0)
摘要:单线程的winfom程序中,设置一个控件的值是很easy的事情,直接 this.TextBox1.value = "Hello World!";就搞定了,但是如果在一个新线程中这么做,比如:private void btnSet_Click(object sender, EventArgs e){ Thread t = new Thread(new ParameterizedThreadStart(SetTextBoxValue)); //当然也可以用匿名委托写成Thread t = new Thread(SetTextBoxValue); t.Start("He 阅读全文
posted @ 2012-03-15 14:08 Danny Chen 阅读(8861) 评论(1) 推荐(4)
摘要:一、软件网站:http://www.nlog-project.org/下载:http://sourceforge.net/project/showfiles.php?group_id=116456说明:如果是.Net 2.0使用, 请下载nlog-1.0-net-2.0.zip 里面的bin目录下有多个,c# 使用nlog.dll文件:nlog.dll大小:248K版本:1.0.0.505二、 WinForm下使用添加nlog.dll的引用,然后在nlog.dll的文件夹下创建nlog.dll.nlog内容如下:<?xml version="1.0" encoding 阅读全文
posted @ 2012-03-15 12:23 Danny Chen 阅读(7711) 评论(0) 推荐(1)
摘要:Declare @Id Int Set @Id = 0; ---在此修改父节点 With RootNodeCTE(NodeId,ParentId,[text],orderid) As ( Select NodeId,ParentId,[text],orderid From S_Tree Where ParentId In (@Id) Union All Select S_Tree.NodeId,S_Tree.ParentId,S_Tree.[text],s_tree.orderid From RootNodeCTE Inner Join S_Tree On RootNodeCTE.NodeI. 阅读全文
posted @ 2012-03-12 23:40 Danny Chen 阅读(290) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 21 下一页