随笔分类 -  Programming

.Net(C#, WPF), OpenGL
摘要:由于InstallShield Limited Edition for Visual Studio的教程、资料太少,所以我今天才决定写这个文章,专门针对C#项目打包,包括打包集成Microsoft .NET Framework等。大家从官方下载的最新版InstallShield Limited Edition for Visual Studio,是支持VS2010、VS2012、VS2013的(小... 阅读全文
posted @ 2016-05-02 01:05 马语者 阅读(3488) 评论(1) 推荐(1) 编辑
摘要:1. 在General Information里,修改Product Version为新的版本号,此版本号应大于旧的版本号。点击Product Code右面的{...},获取一个新的Product Code。不要更换Upgrade Code! 2.“解决方案资源管理器”中选择“1.Organize Your Setup”,然后选择"Upgrade Paths",在左边的“Upgrade... 阅读全文
posted @ 2016-05-02 01:02 马语者 阅读(3857) 评论(2) 推荐(1) 编辑
摘要:compared all possibilities with a long test sheet: 0,140625 sec for lastrow = calcws.Cells.Find("*", [A1], , , xlByColumns, xlPrevious).row 0 sec for 阅读全文
posted @ 2016-02-25 21:28 马语者 阅读(2138) 评论(0) 推荐(0) 编辑
摘要:Search your pc for MSCOMCTL.Ocx. If you find it then register it by clicking on Windows Start Button ~~> Run and then typing this text and pressing En 阅读全文
posted @ 2016-01-27 16:46 马语者 阅读(1329) 评论(0) 推荐(0) 编辑
摘要:在C#中如果存在类的继承关系,应避免在构造函数中调用虚函数。这是由于C#的运行机制造成的,原因如下:新建一个类实例时,C#会先初始化该类(对类变量赋值,并将函数记在函数表中),然后再初始化父类。构造函数的执行则相反,先执行父类的,再执行本身的。如果类包含对父类虚函数的重载,在父类构造函数中调用虚函数... 阅读全文
posted @ 2015-04-27 10:46 马语者 阅读(1797) 评论(0) 推荐(2) 编辑
摘要://值类型 C# 类型 .NET Framework 类型 bool System.Boolean 4Byte 32bit布尔型变量 逻辑值,true或者false,默认值为false byte System.Byte 1Byte 8bit无符号整数无符号的字节,所存储的值的范围是0~255,默认值为0 sbyte ... 阅读全文
posted @ 2015-04-22 15:21 马语者 阅读(2599) 评论(0) 推荐(0) 编辑
摘要:File.WriteAllBytes( @"C:\Windows\System32\MyDll.dll", Resources.MyDll ); 阅读全文
posted @ 2015-03-16 21:05 马语者 阅读(416) 评论(0) 推荐(0) 编辑
摘要:什么是正则表达式 正则表达式是用来检验和操作字符串的强大工具。简单的理解正则表达式可以认为是一种特殊的验证字符串。正则表达式常见运用是验证用户输入信息格式,比如上面的那组“\w{1,}@\w{1,}\.\w{1”,实际上就是验证邮件地址是否合法的;当然正则表达式不仅仅是用于验证,可以说只要运用字符串的地方都可以使用正则表达式; 涉及的基本的类 正则表达式在英文中写作(Re... 阅读全文
posted @ 2015-03-16 17:37 马语者 阅读(3315) 评论(0) 推荐(0) 编辑
摘要:1.字符串:string s1 = "test";string s2 = "test";string s3 = "test1".Substring(0, 4);object s4 = s3;Console.WriteLine("{0} {1} {2}", object.ReferenceEquals... 阅读全文
posted @ 2015-03-12 15:32 马语者 阅读(307) 评论(0) 推荐(0) 编辑
摘要:The following example shows the effect of the Pop command. using System; using System.Windows; using System.Windows.Controls; using System.Windows.Med 阅读全文
posted @ 2015-02-06 09:59 马语者 阅读(741) 评论(0) 推荐(0) 编辑
摘要:OpenFileDialog obj = new OpenFileDialog(); if (obj.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Assembly ass = Assembly.LoadFrom(obj.FileName); foreach(var type in ass.GetType... 阅读全文
posted @ 2015-01-12 19:29 马语者 阅读(1509) 评论(0) 推荐(0) 编辑
摘要:获取变量名字符串: public static string GetVariableName(Expression> memberExpression) { var body = memberExpression.Body as MemberExpression;... 阅读全文
posted @ 2015-01-05 18:08 马语者 阅读(377) 评论(0) 推荐(0) 编辑
摘要:这是.NET反射的一个有趣小例子: 通过反射将变量值转为变量名本身. 当然要先添加命名空间:using System.Reflection; 示例代码如下: class Program { string name = "strA"; string strA = "strB"; string strB = "Hello... 阅读全文
posted @ 2014-12-03 14:45 马语者 阅读(756) 评论(0) 推荐(0) 编辑
摘要:public:对任何类和成员都公开, 无限制访问;protected:仅仅对该类以及该类的派生类公开;private: 仅仅对该类公开;internal:只能值包含该类的程序集中访问该类(只是单独的项目,而不是整个解决方案);protected internal:只能在本类,派生类或者包含该类的程序... 阅读全文
posted @ 2014-11-25 16:56 马语者 阅读(337) 评论(0) 推荐(0) 编辑
摘要:In the previous chapter, we wrote XML using the XmlWriter class. However, for some situations, especially when doing updates of existing XML, using th... 阅读全文
posted @ 2014-11-17 15:58 马语者 阅读(384) 评论(0) 推荐(0) 编辑
摘要:if ((Keyboard.Modifiers & ModifierKeys.Control) > 0 && (e.Key == Key.Delete)) { CabinetElement.RemoveActiveCabinets(this); } 阅读全文
posted @ 2014-10-29 20:52 马语者 阅读(605) 评论(0) 推荐(0) 编辑
摘要:XAML本身没有Region标签功能,很郁闷。现在有插件可以实现该功能了! <!-- Region (Any Text You Want) --> Your Code <!-- EndRegion --> 远程下载:http://visualstudiogallery.msdn.microsoft. 阅读全文
posted @ 2014-09-25 10:36 马语者 阅读(1377) 评论(0) 推荐(1) 编辑
摘要:Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past ... 阅读全文
posted @ 2014-06-27 09:44 马语者 阅读(640) 评论(0) 推荐(0) 编辑
摘要:用 System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();watch.Start();for (int i = 0; i "000" + x);//Linq,返回IEnumerable}watch.Stop(); 阅读全文
posted @ 2014-06-22 18:40 马语者 阅读(944) 评论(0) 推荐(0) 编辑
摘要:编译项目,出现提示"Lc.exe已退出,代码为-1" 。 解决办法: 意思就是把licenses.licx这个文件里的内容删除,但是文件还在(此时是个空文件),发生这个问题的原因主要是因为你可能引用了第三方控件但没有注册,删完后,重新编译就一切OK了! 阅读全文
posted @ 2014-06-17 10:00 马语者 阅读(419) 评论(0) 推荐(0) 编辑