摘要: 直接看原文:http://www.brokenthorn.com/Resources/OSDevIndex.html 阅读全文
posted @ 2014-10-15 03:10 玄奘三藏 阅读(183) 评论(0) 推荐(0) 编辑
摘要: private string GetToJson(object dic){//实例化JavaScriptSerializer类的新实例JavaScriptSerializer jss = new JavaScriptSerializer();try{//将对象序列化为json数据return jss... 阅读全文
posted @ 2014-06-09 02:47 玄奘三藏 阅读(166) 评论(0) 推荐(0) 编辑
摘要: C++获取代码运行时间如何获取代码运行时间在调试中,经常需要计算某一段代码的执行时间,下面给出两种常用的方式:第一种:使用GetTickCount函数#include#includeint main(){DWORD start_time=GetTickCount();{//此处为被测试代码}DWOR... 阅读全文
posted @ 2014-04-26 16:18 玄奘三藏 阅读(2397) 评论(0) 推荐(0) 编辑
摘要: 一: DateTime BeginTime = System.DateTime.Now; //代码 DateTime EndTime = System.DateTime.Now; TimeSpan ts = EndTime.Subtract(BeginTime); MessageBox.Show(ts.TotalMilliseconds.ToString()); 二: System.Diagnostics.Stopwatch watch = new System... 阅读全文
posted @ 2014-04-03 02:11 玄奘三藏 阅读(538) 评论(0) 推荐(0) 编辑
摘要: centos6.2nginx:1.5.4php:5.5.3mysql:5.6.131、环境情况:操作系统:windows8虚拟主机:vmware workstation虚拟系统:centos6.2操作用户:cwt(注意:非root)实现目的:PHP环境2、安装依赖的库yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 gl 阅读全文
posted @ 2014-03-02 23:17 玄奘三藏 阅读(1635) 评论(0) 推荐(0) 编辑
摘要: //计算两点之间距离#include#includeusing namespace std;class Point;class test{public: double dist(Point &p1,Point &p2);};class Point{private: int x,y;public: Point(int xx=0,int yy=0) { x=xx; y=yy; } void display() { cout"; p2.display(); test a; cout<<"距离:"<<a.dist(p1,p2)< 阅读全文
posted @ 2014-02-08 18:31 玄奘三藏 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 DWORD WINAPI ThreadProc(LPVOID lpParam) 6 { 7 int i=0; 8 while(i<20) 9 {10 //cout<<"I am from a thread ,count="<<i++<<endl;11 printf("I am from a thread ,count=%d\n",i++);12 Sleep(500);13 }14 re... 阅读全文
posted @ 2013-11-25 14:35 玄奘三藏 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 首先写一个是测试程序(game.exe)代码如下:#include #include #include int g_nNum;void main(int argc, char* argv[]){ int i=198; g_nNum=1003; while (1) { printf("i=%d,addr=%08lX; g_nNum=%d,addr=%08lX\n",++i,&i,--g_nNum,&g_nNum); getchar(); } return;}目的是要搜索和修改game... 阅读全文
posted @ 2013-11-25 07:27 玄奘三藏 阅读(2402) 评论(0) 推荐(0) 编辑
摘要: #include #include #include int main(int argc, char* argv[]){ PROCESSENTRY32 pe32; pe32.dwSize=sizeof(pe32); HANDLE hProcessSnap=::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); if (hProcessSnap==INVALID_HANDLE_VALUE) { printf("出错\n"); return -1; } BOOL bMore=::Process32First(hProcessSnap, 阅读全文
posted @ 2013-11-25 01:52 玄奘三藏 阅读(1249) 评论(0) 推荐(0) 编辑