随笔分类 -  C#

摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Maishuwenti{ class Program { public const int larg = 100000; static void Main(string[] args) { int[] n1 = new int[] {3,4,2,1,0}; double solution = find_BestSol... 阅读全文
posted @ 2012-01-02 11:12 郑小明 阅读(582) 评论(0) 推荐(0)
摘要:遇到了一个问题。C#工程中添加了dll文件,但是编译运行时却报错,提示无法加载DLL文件。最后在网上找到了解决方法。即把这些无法引用的dll文件拷贝到C盘system32文件夹下,这样只后,果然运行顺利。知识来源:http://zhidao.baidu.com/question/217254621.html 阅读全文
posted @ 2011-09-22 01:30 郑小明 阅读(5590) 评论(0) 推荐(0)
摘要:原文地址:http://stackoverflow.com/questions/3926500/base-invoke-with-delegates问题:I am invoking a delegate and I'm not very informed about how it works and I have compilation errors because of it (Compiler Error CS1660). This is the code I have for it:base.Invoke( delegate { bool flag = (((th... 阅读全文
posted @ 2011-09-22 00:55 郑小明 阅读(709) 评论(0) 推荐(0)
摘要:直接上代码,主要部分为设置操作graphics对象的Transform属性。using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace BarChart { public partial clas... 阅读全文
posted @ 2011-08-18 15:57 郑小明 阅读(324) 评论(0) 推荐(0)
摘要:声明:只翻译了要点,忘见谅。获得一个在其上绘画的Graphics对象的方法主要有四种:1、调用一个窗体或者控件的CreateGraphics方法2、调用Graphics类的FromImage方法3、使用Paint事件处理函数中的e.Graphics参数4、使用PrintDocument对象的PrintPage事件处理函数的e.Graphics参数1.使用CreateGraphics范例式使用语句为:Graphics gr = this.CreateGraphics(); gr.FillEllipse(Brushes.Yellow, 10, 30, 200, 150); gr.DrawEllip 阅读全文
posted @ 2011-08-08 15:53 郑小明 阅读(1034) 评论(0) 推荐(0)
摘要:看了这上面(http://ishare.iask.sina.com.cn/f/17387204.html)《经典算法研究by_July》关于动态规划的算法,研究了一下现把经验教训道之一二。具体关于动态规划为何物的介绍就不再啰嗦了,具体请看如上链接中的介绍,单对算法实现层次参数的理解给予明确。题目如下:题目:如果字符串一的所有字符按其在字符串中的顺序出现在另外一个字符串二中,则字符串一称之为字符串二的子串。注意,并不要求子串(字符串一)的字符必须连续出现在字符串二中。请编写一个函数,输入两个字符串,求它们的最长公共子串,并打印出最长公共子串。例如:输入两个字符串BDCABA和ABCBDAB,字符 阅读全文
posted @ 2011-07-25 22:09 郑小明 阅读(1868) 评论(0) 推荐(0)