惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 聂微东
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
博客园 - Franky
小众软件
小众软件
罗磊的独立博客
G
Google Developers Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
腾讯CDC
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
T
Threatpost
L
LINUX DO - 热门话题
P
Privacy & Cybersecurity Law Blog
J
Java Code Geeks
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
NISL@THU
NISL@THU
M
MIT News - Artificial intelligence
Cisco Talos Blog
Cisco Talos Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Heimdal Security Blog
The Last Watchdog
The Last Watchdog
量子位
P
Palo Alto Networks Blog
W
WeLiveSecurity
H
Hacker News: Front Page
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
爱范儿
爱范儿
V
Vulnerabilities – Threatpost
Engineering at Meta
Engineering at Meta
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Security Affairs
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
A
Arctic Wolf
大猫的无限游戏
大猫的无限游戏
T
The Exploit Database - CXSecurity.com
Hacker News: Ask HN
Hacker News: Ask HN
C
Cisco Blogs
Jina AI
Jina AI

博客园 - .net技術

makefile c语言难点 线程同步(转) stl学习(转帖2) stl 学习(转帖) visual C++ 6.0开发工具与调试 vc动态装载动态库 详细的MySQL C API CString,string,char*的综合比较 在Linux下安装和使用MySQL 人际关系的55个绝招 一个封装的socket类 一个linux下c++程序 一个网络扫描程序 VC数字图像处理编程 ASCII 防盗链IHttpHandler(转自垃圾猪) 按比例显示图片大小 回车改变焦点
一些函数
.net技術 · 2006-04-03 · via 博客园 - .net技術

char t[30];
strcpy (t, "接收上线请求");
 
char sql[300] = {0};
sprintf (sql, "update tab_zxk set wssj = %d where kh = \'%s\'", nowtime, buf->card_no);
memset(sql, 0, 300);


钩子函数:
g_Hook = SetWindowsHookEx(WH_CBT, CBTProc, NULL, GetCurrentThreadId()); 
LRESULT CALLBACK CBTProc(
  int nCode,      // hook code
  WPARAM wParam,  // depends on hook code
  LPARAM lParam   // depends on hook code
)
{
// if(g_hWnd == wParam )
 if(nCode == HCBT_MINMAX && lParam == SW_MINIMIZE)
  return 1;
 else
  return CallNextHookEx(g_Hook, nCode, wParam, lParam);
}

文件操作:

 int newkalen=strlen(kahao);
 char *pKa=new char[newkalen];
 strncpy(pKa,kahao,newkalen);
 pKa[newkalen] = '\n';
 FILE *fp  = NULL;
       if((fp=fopen(m_KahaoFile,"a+"))==NULL)  //打开卡号包明文
 {
  return 0;
 }
 fwrite (pKa, newkalen+1, 1, fp);   \\其中添加一个'\r'
       fclose(fp);
       delete []pKa;
//////////////////////
                        char m_KahaoBuf[KAHAOBUFNUM][MAXKALEN];
                        char c;
                       for(i=0;i<readcount;i++)  
   {
    k=0;
    while((c=fgetc(fp))!=EOF)    //读出卡号到缓冲区
    {
                       #ifdef WIN32
                       #else
     if('\r'==c)continue;
                       #endif
     if('\n'==c)
     {
      m_KahaoBuf[i][k]='\0';
      break;
     }
     m_KahaoBuf[i][k]=c;
     k++;
    }
   }

//////////////////////////////

                                         //写入临时文件
                                         FILE *fptemp = NULL;

                          fptemp=fopen(KahaoFileTemp,"w"); 
     for(i=0;i<=readcount;i++)
     {
      k=0;
      while('\0'!=m_KahaoBuf[i][k])  //注意'\0'
      {
       fputc(m_KahaoBuf[i][k],fptemp);
       k++;
      }
      fputc('\n',fptemp);    //注意'\n'
     }
                                         fclose(fptemp);

///////////////////////////
  socket程序:
        const char *pHost;
        int nPort;
        struct sockaddr_in addr;        //sockaddr_in包括in_addr结构
 struct hostent *phe = NULL;

 memset (&addr, 0, sizeof (addr));
 addr.sin_family = AF_INET;
 addr.sin_port = htons (nPort);

 if ((addr.sin_addr.s_addr = inet_addr (pHost)) == (unsigned long int) -1)        
 {
  if ((phe = gethostbyname (pHost)) == NULL)
   return 0;

  memcpy ((char *)&addr.sin_addr, phe->h_addr, phe->h_length);
 }

 connect (m_nSock, (struct sockaddr *)&addr, sizeof (addr)) ;
//////////////////////////////////////////

       struct in_addr in_address;                 //sockaddr_in包括in_addr结构
        char a[20];
 in_address.s_addr = n;
 strcpy (a, inet_ntoa (in_address));           

自定义消息:
头文件:
#define WM_RECVDATA  WM_USER+1
 afx_msg void OnRecvData(WPARAM wParam,LPARAM lParam);

cpp文件:
ON_MESSAGE(WM_RECVDATA,OnRecvData)