
c++
book2016
有诸于内,必形于外
展开
-
use AT command to send a sms in linux system
int SendMySMS(const char* smsc,const char * mobile, const char * msg){ Smg sndinfo; sprintf(SMSC,smsc); memset( &sndinfo, 0x0, sizeof( sndinfo ) ); sprintf( sndinfo.mobile, mob原创 2008-09-08 16:55:00 · 902 阅读 · 0 评论 -
linux 通过域名获得ip
代码#include #include int main(int argc, char *argv[]){ if (argc != 2) { printf("Usage:%s domain_name\n", argv[0]); return 1; } str原创 2012-03-20 10:44:36 · 4103 阅读 · 0 评论 -
vc++ greta html转 txt
CString html2txt(CString html){ CString m_strReg="]*?>.*?|]*?>.*?|]*?>|"; CString m_strResult = ""; REGEX_FLAGS dw = GLOBAL | ALLBACKREFS | NOCASE; rpattern pat((LPCTSTR)m_strReg, "",原创 2011-11-07 15:39:05 · 805 阅读 · 0 评论 -
c++中的hash map
Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里说下map内部数据的组织,map内部自建一颗红黑树(一种非严格意义上的平衡二叉树),这颗树具有对数据自动排序的功能,所以在map内部所有的数据都是有序的,后边我们会见识到有转载 2011-10-27 16:37:44 · 965 阅读 · 0 评论 -
关于内存崩溃经验
例如开10个子进程(1)尽量不要在子进程中分配和释放内存,比如可以可以先分配好固定的10块内存,每次拿空闲的给某个子进程用。类似内存池的思想。(2)尽量不要在子进程内调用界面ui元素的实例,尽量使用windows消息机制,将操作发送到ui元素的句柄。实在不熟悉的消息需要调用ui元素的话,可以做个原子互斥。让子进程对ui元素的操作互斥住。(3)尽量不要在子进程内使用全局变量,实在要用的话原创 2011-10-24 17:10:45 · 2707 阅读 · 0 评论 -
login into sms gateway
1.login into telecom sms gateway java int len = 42; buf = new byte[len]; TypeConvert.int2byte(len, buf, 0); //00 00 00 2a TypeConvert.int2byte(1, buf, 4); //00 00 00 2a原创 2008-12-14 11:47:00 · 1417 阅读 · 0 评论 -
how to compile gnugk
1./root下 tar zxvf pwlib.tar.gz cd pwlib./configuregmake2./root下 tar zxvf openh323.tar.gz cd openh323./configuregmake3./etc/profile增加如下内容 OPENH323DIR=/root/openh323 export OPENH323DIR OPENH323MAKEDIR=/原创 2008-12-10 20:55:00 · 685 阅读 · 0 评论 -
how to test the real character number if the string include chinese character,notice one chinese character only calculater one b
int first(unsigned char ch){if(ch>=0xb0&&ch return 1;else return 0;}int second(unsigned char ch){ if(ch>=0xa1&&ch return 1;else return 0;}int check(const char* p){int i=0;for(i=0;i if(first(p[i]原创 2008-10-09 23:13:00 · 693 阅读 · 0 评论 -
how to get url and hostname and url text in one page
STDMETHODIMP CIEHlprObj::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pvarResult, EX原创 2008-10-01 11:25:00 · 895 阅读 · 0 评论 -
how to test IEHelper.DLL
1.compile one IEHelper.dll program2.copy the dll into C:/windows/system323.input dos cmd :C:/WINDOWS/system32>regsvr32 IEHelper.dll4.close all ie explore browser5.open a new ie explore browser,your原创 2008-10-01 11:23:00 · 715 阅读 · 0 评论 -
Get the data of today only use c language
#include void CTestDlg::OnOK() {time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); char nowtime[200];sprintf (nowtime, "%4d_%02d_%02d",1900+timeinfo->tm_year原创 2008-10-01 21:35:00 · 669 阅读 · 0 评论 -
Use windows socket to download http page
1)Because we need use windows socket to get http page,we need initialise win socketAt the beginning of our application,we should do below: int err; WORD wVersion; WSADATA WSAData; wVer原创 2008-10-01 17:08:00 · 1353 阅读 · 0 评论 -
receive sms in linux and decode chinese
int gsmDecodePdu(const char* pSrc, SM_PARAM* pDst){ int nDstLength; // 目标PDU串长度 unsigned char tmp; // 内部用的临时字节变量 unsigned char buf[256]; // 内部用的缓冲区 PString bufsmsget=p原创 2008-09-08 16:57:00 · 1032 阅读 · 0 评论 -
渗透课程笔记
由于仅仅是听课笔记,错漏均会有,原理是正确的1.环境主机1 192.168.0.1011)win2003操作系统2)开启apache+mysql+php+wordpress 其中 apache以低权限用户webmaster运行,使用端口80wordpress暴露漏洞形式如下XXX.php$path_array = array("xxxpath" => "../.原创 2013-07-24 12:55:06 · 1261 阅读 · 0 评论