veteran
eteran · 共 20 篇文章
注册表操作类 vc++
这个其实发在这里有点不合适,因为在.NET环境下本身很多数据都采用xml格式化,存储在本地,另一方面是.net的类库也非常的灵活,对注册表操作非常方便,没有必要画蛇添足来这么一个包装的类,但是如果你用 vc++ , WIN32 API ,做开发的时候,你会发现要对注册表操作非常的困难,更让人寒心的是,它居然没有提供对注册表键的重命名,在NTDLL.dll 中有一个可以替代的API:NTRenameKey, 但是它只有winXP之后的操作系统才提供,所以,笔者在这里提供这样一个操作类,主要是弥补了 WIN32 API 在这方面的不足。如果读者有兴趣的话可以去看 Dan Madden 写的一篇文…
2008-04-18 17:12 · [随笔分类]c++ · 评论(0)
How to debug windows service
1) Add such code to the service's entry, static Main() function, #if DEBUG System.Diagnostics.Debugger.Launch(); #endif 2) install your windows service appliation with visual studio command tool. command line as follow: installUtil.exe <Application's name> 3) Open your windows service source code w…
2008-02-16 13:56 · [网站分类].NET新手区 · 评论(0)
一个舞台剧的小剧本, 希望能博得大家的一笑
旁白1: K先生和F小姐已经快要有孩子了,但是他们非常的害怕辐射对他们的宝宝产生影响,所以为了保护好他们的宝宝,他们杜绝了使用一切电器,一天,K先生陪着他的太太去看望他的丈母娘。 K**先生和他的太太出场。 路人甲拿着手机,做通话的模样匆匆走过,K和F做惊慌逃离状。10S 旁白2(模拟手机的声调):叮叮叮,大家好我是手机,当你们用我通话的时候,我会向发射基站传送无线电波,而任何一种无线电波或多或少地会被人体吸收,从而改变人体组织,特别信号刚接通时,因为这时信号传输系统还不稳定,处在最大工作功率状态。嘿嘿,你们用我的时候可要小心哦。 路人乙上场,边听音乐边摇头晃脑,做陶醉状。K和F做惊恐逃离状…
2007-11-04 21:47 · [网站分类]非技术区 · 评论(0)
加解密字符串和字符编码的一些误区
最近做的项目中要用到字符串的加解密,在.net framework的System.Security命名空间下,系统为我们提供了丰富的类库,方便了我们的工作,但是在实际工作中,我们还是会犯这样或者那样的错误,所以我在这里就我工作中遇到的问题做一下说明,避免后来人再犯。 首先我们来看一段代码,当你在google或者baidu中搜索c# 加密字符串的时候,你会找到很多这种类似的代码:
2007-10-31 21:56 · 评论(0)
加解密字符串和字符编码的一些误区
最近做的项目中要用到字符串的加解密,在.net framework的System.Security命名空间下,系统为我们提供了丰富的类库,方便了我们的工作,但是在实际工作中,我们还是会犯这样或者那样的错误,所以我在这里就我工作中遇到的问题做一下说明,避免后来人再犯。 首先我们来看一段代码,当你在google或者baidu中搜索c# 加密字符串的时候,你会找到很多这种类似的代码:
2007-10-31 21:52 · 评论(0)
CAS 代码访问安全性二 (翻译)
试一下下面的代码,我们之前没有使用security命名空间,但是我们现在来用用看。 <!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->using System.Security; using System.Security.Permissions; 添加另一个button到已经存在的form上。 <!--<br /> <br /> Code highlighting pr…
2007-10-29 09:39 · [发布至博客园首页] · 评论(0)
CAS 代码访问安全性 (翻译)
前言: 用vs2005 + vsto 开发一个outlook的addin的时候,碰到了一个问题,在我机器上运行的好好的程序,用vs自己的打包安装程序安装到别的机器的时候总是显示 not load, 加载程序的时候出错。google了一下,遇到了一个新名词, CAS: code access security. 找不到相关的中文文档。在codeproject上看到了这篇文章。文章比较长,有codeproject的文风,讲解的非常详细,就是一点基础都没有的人都知道他说什么,但是要耐心看。 ^_^ Role Based Security (not being discussed in this a…
2007-10-27 20:10 · [发布至博客园首页] · 评论(0)
boost 的安装
vc8 下用到boost 类库,没找到安装的办法,google 了一下,找到了一些介绍安装的方法,比如 http://hi.baidu.com/atry/blog/item/46950ad738c635dca044dff0.html 然后我傻乎乎的按照他的方法去做,结果装了我 2 个小时,在c盘留下了 2G 多的垃圾文件。 后来我想boost的类库应该是可以单独安装的,而我的项目中用到的仅仅是regex的部分,最终在<uncompress dir>\boost_1_34_0\libs\regex\下面找到了一个index.html文件,上面写明了安装regex类库的方法。 翻译如下(英文一半…
2007-10-15 16:35 · [随笔分类]c++ · 评论(0)
Contribute some useful custom control: XListCtrl
In my VC MFC develop expericence, I always find that it is really poor of the Ctrls that microsoft provided, but we have no much project budget to bug a beautiful third-ctrl. So sometimes we need do some work to modify the standard Control. For the purpose of reuse, I have my library database, thou…
2007-08-24 11:22 · [随笔分类]c++ · 评论(0)
Navigate2 compare with Navigate
CWebBrowser2 ctrl provide two method to link a web page: Navigate2(VARIANT* URL, VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData, VARIANT* Headers) Navigate(LPCTSTR URL, VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData, VARIANT* Headers) My requirement is very simple, give a …
2007-08-17 19:43 · [随笔分类]c++ · 评论(0)
黑蝙蝠中队 A better day
Chorus A better day when night belongs to dawn Another way for us to get along Although some might say its never meant to be You gotta be strong, a better day will come This ain't fiction, its all reallity You better listen because this means a lot to me I got something to say just give a moment of…
2007-06-06 12:26 · [网站分类]非技术区 · 评论(0)
new delete 非常奇怪的内存问题
代码如下: <!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->int i = 0, j = 0; CJob** ppJobs = NULL; try { int nCount = m_xlist.CountCheckedItems(0); if (nCount) { ppJobs = new CJob*[nCount]; for (; i < m_xlist.GetItemCount(); i++) …
2007-06-06 12:14 · [随笔分类]c++ · 评论(0)
Windows Credential Management with the .net Framework 2.0(翻译)
原文链接 <meta name="ProgId" content="Word.Document"> <meta name="Generator" content="Microsoft Word 11"> <meta name="Originator" content="Microsoft Word 11"> <link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C03%5Cclip_filelist.xml"> <link rel="Edit-Time-…
2007-06-05 00:04 · [随笔分类]c++ · 评论(0)
VC8 VS VC6
VC8 VS VC6 Why need we migrate from vc6 to vc8? (for developer, for final user, for IT corporation) Key words: visual c++ 6.0, visual c++ 8.0, visual studio 2005 What’s new in Visual C++ 8.0? Libraries Changes As of Visual C++ 2005, the Standard C++ Library and the ATL, MFC, and CRT libraries are s…
2007-05-20 14:22 · [随笔分类]c++ · 评论(0)
肇庆两日自助游的策划
51 和 十一期间这个计划要做相应改动。 希望对出游的朋友有个参考作用。 肇庆两日游策划书 Tip: 七星岩 音乐喷泉 鼎湖山 千年诗廊,石室岩洞,双源洞,鹤园 玉屏山 阆风岩 景点介绍: 七星岩: 七星岩位于肇庆市区北约<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="4" unitname="公里" w:st="on"><span lang="EN-US">4</span><span style="font-family: 宋体;">公里</span></chmetcnv>处。…
2007-05-20 14:15 · [网站分类]非技术区 · 评论(0)