[置顶] C# .net中获取台式电脑中串口设备的名称

摘要: 1、情境:做项目的时候要打开串口然后进行一些库函数的调用来操作目标板。串口使用的是usb转串口,板子插进拔出的,每次都使用不一样的usb口,debug的时候懒得每次改com口,又不想在UI上加上一个选择com口的combox,于是就使用了下面这个方法。2、环境:win7 64、vs20103、目标:... 阅读全文

posted @ 2014-10-16 15:10 siszqsqx 阅读(5828) 评论(1) 推荐(0) 编辑

2015年2月10日

打印出C# 中float ,double 在内存中的存放形式

摘要: 1 float floatA = 2.2f; 2 uint a = BitConverter.ToUInt32(BitConverter.GetBytes(floatA), 0); 3 for (int i = 0; i < ... 阅读全文

posted @ 2015-02-10 17:25 siszqsqx 阅读(1069) 评论(0) 推荐(0) 编辑

2015年1月2日

VS2010 C++ 创建COM组件

摘要: 1、项目中要使用到com组件,于是了解了一下com,并根据《C#高级编程》中关于com的介绍用vs创建了一下com,用于实验。以下均根据书中的demo做一遍,熟悉一下而已。2、创建CoM组件不能使用C++或VB2010,而应使用VB6.0或C++。以下使用ATL、C++、VS2010. 使用C#或... 阅读全文

posted @ 2015-01-02 19:42 siszqsqx 阅读(7092) 评论(0) 推荐(2) 编辑

2014年12月25日

.net 中两个日期算经过的月份数

摘要: 1 DateTime startDate = DateTime.Parse("2014-11-1");2 DateTime endDate = DateTime.Parse("2015-9-1");3 int totalMont... 阅读全文

posted @ 2014-12-25 20:44 siszqsqx 阅读(620) 评论(0) 推荐(0) 编辑

一种计算MD5的实现方法

摘要: 1、在需要用到加密的地方可以使用.net中的md5相关的类生成md5给文件加密。2、基本思路:将文件也好,字符串也好,转成字节数组,再利用.net的md5相关类生成md5相关字符串,再将字符串转成16进制。3、具体的例子: 1 using System; 2 using System.Collect... 阅读全文

posted @ 2014-12-25 19:39 siszqsqx 阅读(403) 评论(0) 推荐(0) 编辑

将文件从程序集中复原

摘要: 1、场景:发到客户那的程序中使用的一个C++的库需要被替换,而该库在使用了前使用了md5进行检验防止其它伪装的库将其替换,因而替换时要算目标库的md5,并把使用该库的另一个库也换掉。2、涉及技术:做一个离线补丁包去升级程序,并将库文件集成到其中,程序运行时再将其释放出来。3、解决方法:将目标库当成资... 阅读全文

posted @ 2014-12-25 19:19 siszqsqx 阅读(240) 评论(0) 推荐(0) 编辑

C# 获取文件版本

摘要: var versionInfo = FileVersionInfo.GetVersionInfo(filePath); String productVersion = versionInfo.ProductVersion; String fileVersion = versio... 阅读全文

posted @ 2014-12-25 18:57 siszqsqx 阅读(869) 评论(0) 推荐(0) 编辑

2013年4月19日

Git(to be continued...)

摘要: You tell Git you want to save a snapshot of your project with thegit commitcommand and it basically records a manifest of what all of the files in your project look like at that point. Then most of the commands work with those manifests to see how they differ or pull content out of them.If you think 阅读全文

posted @ 2013-04-19 15:11 siszqsqx 阅读(260) 评论(0) 推荐(0) 编辑

2013年4月18日

autoconf & automake

摘要: 1、Function of these two tools:Generateshell scriptfile"configure" for our source code, which can help to configure our source code in different unix-like system and generate file "Makefile".Then we can use instructions such as "./configure"、"make"、"make i 阅读全文

posted @ 2013-04-18 17:14 siszqsqx 阅读(165) 评论(0) 推荐(0) 编辑

2013年4月12日

Share WIFI in Windows 7

摘要: 1 netsh wlan set hostednetwork mode=allow2 netsh wlan set hostednetwork ssid=benson key=asdfg123453 netsh wlan start hostednetwork4 #pause5 #单击“本地连接”选择“属性”,再选择“共享”将里面的两个连接共享的设置都打上勾,6 #其中“家庭网络连接”那个框上面的字体应该为“OPEN”这个网络的连接名字7 #将netsh wlan start hostednetwork 另存为xxx.bat,放入start中即可实现开机启动无AP 阅读全文

posted @ 2013-04-12 21:38 siszqsqx 阅读(267) 评论(0) 推荐(0) 编辑

导航