- 博客(24)
- 资源 (12)
- 收藏
- 关注
原创 判断处于某段时间内
struct Date { short year; short mon; short day; Date(short y, short m, short d) : year(y), mon(m), day(d) {} private: Date() {} }; int BetweenDates(time_t tSecond, Date& dateBegin, Date& da
2012-03-07 10:44:31
257
原创 epoll 模型
#include #include #include #include #include #include #include #include #include #include using namespace std; const char g_host[] = "192.168.1.250"; unsigned short g_port = 10086; const in
2012-02-24 16:03:31
292
原创 C 去除字符串中连续重复的字符
// 2011.10.24 11:10 by ZJ // abcddef -> abcdef // NULL -> NULL char *NoRepeat(char *str) { if (!str) { return NULL; } int iFlag = 0; bool bSwap = false; for (int i = 0; *(str + i) != '\0
2011-10-24 23:08:42
491
原创 排序
1、冒泡排序 // 将数组中最大或者最小值元素后移 #include using namespace std; void Bubble(int *pArray, const int size) { if (!pArray) { return; } bool b
2011-10-11 00:02:09
783
原创 iocp 完成端口模型
// my_iocp.cpp #include #include #include using namespace std; #pragma comment (lib, "ws2_32") typedef struct { SOCKET socket; }PER_
2011-10-09 00:08:00
330
原创 通知栏-Shell_NotifyIcon
#include #include #define NOTIFY_MSG WM_USER + 1000 #define NOTIFY_UID 1000 LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM
2011-09-13 17:21:09
290
原创 JS读取txt文档
function ReadConfig() { var s = ""; var read = 1; var fso = new ActiveXObject("Scripting.FileSystemObjec
2011-08-08 22:59:11
425
原创 CreateProcess 注意点
BOOL CreateProcess( LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTE
2011-07-27 16:32:49
301
原创 ICMP Ping
#include #include #include #include #pragma comment(lib, "WSOCK32") #define ICMP_DLL "ICMP.DLL" typedef struct tagIPINFO { u_char Ttl; // Time To Live u_char Tos; // Type Of Server u_char IPFlags; // IP flags u_char OptSize;
2010-11-29 23:57:00
301
原创 操作注册表
<br />注册表中可以自启动的键值:<br />HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run<br />HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/RunOnce<br />HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run<br />HKEY_LOCAL_MACHINE/
2010-10-09 22:37:00
332
原创 隐藏控制台窗口运行控制台程序
<br />// windows类型,而入口为main,则不以控制台形式显示 #pragma comment( linker, "/subsystem:/"windows/" /entry:/"mainCRTStartup/"" )
2010-10-07 19:46:00
267
原创 AutoDel
自删除 @echo off start if exist XX del XX goto start if not exist XX goto end end del %0
2010-10-02 12:46:00
324
原创 socket编程:select模式 下载
服务器:// BinaryAndHex.h: interface for the CBinaryAndHex class. // ////////////////////////////////////////////////////////////////////// #if !defined BINARYANDHEX_H #define BINARYANDHEX_H #include using std::string; #if _MSC_VER > 1000 #pragma
2010-09-20 17:24:00
577
原创 socket编程:select 用法 例子
<br />鄢写的,参考之用<br />/////////////////////////////////////////////////////////////<br />服务器:<br />#include <stdio.h> #include <string.h> #include <WINSOCK2.H> #pragma comment(lib,"ws2_32.lib") #define INT_SERVER_PORT 6002 #define STR_SERVER_IP "127
2010-09-19 17:20:00
2568
原创 socket编程:select多路复用 服务器
#include #include using namespace std; #pragma comment (lib, "ws2_32.lib") ///////////////////////////////////////////// #define IP "127.0.0.1" #define PORT 10000 #define CONNECT_TIP "You are connected!" #define BACK_LOG 10 //////////////////
2010-09-17 17:11:00
668
原创 ADO例子:检验登录信息
#import "C://Program Files//Common Files//System//ado//msado15.dll" no_namespace rename("EOF", "adoEOF") rename("BOF", "adoBOF") //////////////////////////////////////// #include using std::cout; using std::endl; //////////////////////////////////
2010-09-16 16:37:00
350
原创 不要使用多态性数组
《More Effective C++》 条款三:#include using namespace std; class BST { public: int m_nIndex; friend ostream& operator
2010-09-14 14:36:00
442
1
原创 笔记:创建状态栏、工具栏
笔记:创建状态栏 RECT rect; GetClientRect(&rect); rect.top = rect.bottom - 20; m_StatBar.Create(WS_BORDER | WS_VISIBLE | CBRS_BOTTOM, rect, this, 3); int nParts[4] = {100, 200, 300, 100}; m_StatBar.SetParts(4, nParts); m_StatBar.SetText("第一个指示器", 0,
2010-09-10 14:05:00
261
原创 CMarkup 使用 总结
<br />#define XML_ROOT "<root/>" class CCMarkupTestDlg : public CDialog { ... public: afx_msg void OnBnClickedAdd(); afx_msg void OnBnClickedDelete(); afx_msg void OnBnClickedLoad(); afx_msg void OnBnClickedExport(); // 初始化xml文件导入
2010-09-10 11:42:00
1149
原创 WPARAM、LPARAM
<br />WM_COMMAND wNotifyCode = HIWORD(wParam); //它的高位是通知码 wID = LOWORD(wParam); //低位才是控件的ID hwndCtl = (HWND) lParam; //控件的句柄
2010-08-30 20:47:00
237
原创 ADO 经验积累
ADO连接数据库出现的异常: string strSql("select loginPwd from users where userID = 'admin'"); pRecordset->Open((_bstr_t)strSql.c_str(), pConnection.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText); 'admin'单引号忽略会出现:至少一个参数没有被指定值的。
2010-08-09 15:55:00
237
原创 连接Oracle数据库字符串 范例
// 服务名:通常是其全局数据库名(Oracle Net Configuration // Assistant: Net 这样解释),我理解为就是要连接的远程数据库名。 string strConnect; // 未配置本地客户端 strConnect = "Provider=
2010-08-05 10:33:00
643
原创 采用最小代价将 0 移到末尾
// 采用最小代价将 0 移到末尾 void RightZero(int* a, int size) { int flag = -1; for (int i=0; i
2010-07-30 15:34:00
218
ACE ACE自适配通信环境
2010-09-21
UNIX 系统基础 主要特性
2010-07-30
TCP-IP详解卷二:实现
2011-05-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人