zoukankan      html  css  js  c++  java
  • vc6开发笔记一

    获得时间、目录

    #include <window.h>

    //获得当前时间

    SYSTEMTIME time;

    GetLocalTime(&time);

    GetSystemTime(&time);

    //获得当前工作目录

    char path[255];

    GetCurrentDirectory(255, path);

    printf("%04d", 12);//打印0012

    //获得程序目录

    GetModuleFileName(NULL, path, 255);

    获得进程号

    //获得指定名的进程号

    #include <tlhelp32.h>

    DWORD GetProcessidByName(LPCTSTR name) {

      PROCESSENTRY32 pe;

      DWORD id = 0;

      HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

      pe.dwSize = sizeof(pe);

      if (!Process32First(hSnapshot, &pe)) return 0;

      while(1) {

        pe.dwSize = sizeof(pe);

        if (Process32Next(hSnapshot, &pe) == FALSE) break;

        if (strcmp(pe.szExeFile, name) == 0) {

          id = pe.th32ProcessID;

          break;

        }

      }

      CloseHandle(hSnapshot);

      return id;

    }

  • 相关阅读:
    密码加密
    注册视图
    session会话
    验证码功能
    使用Django表单替代html表单
    实现登陆视图功能
    设计登陆需求页面
    配置视图
    配置数据库
    npm 学习
  • 原文地址:https://www.cnblogs.com/feilv/p/4065241.html
Copyright © 2011-2022 走看看