标签为 "C++" 的存档

C#获取本机CPU、内存信息类

代码写的很烂,多多包涵就是了,用起来感觉还可以,需要几个using:

using System.Runtime.InteropServices;
using System.Management;

其中System.Management需要手工添加,发布时,需要附带System.Management.dll。

阅读更多…

一个小细节:Security Enhancements in the CRT

最近写点小程序,为了安全性,打算改写部分CRT函数成secure versions of run-time library routines。最初的想法是,对于这类函数,一般就是加上_s,有的需要加个参数就可以了。没什么其他的需要修改。前段时间改了一个程序,因为写的不是很标准,就出了一点小问题。拿一个来说说:

阅读更多…