zoukankan      html  css  js  c++  java
  • ePass.CreateFile

    javascript和vbscript中没有结构体Struct,ePass的ActiveX对象中把各个参数都展开了,官方文档只给出了对应的代码,没有给出相应的数字,示例代码中却都是数字,其VC代码中有对应的定义,如下

    ePass.CreateFile(IFlags, ulID, ulFileSize, ucFileType, ucReadAccess, ucWriteAccess, ucCryptAccess, ucGrantedAccess);

    ////
    /// EPAS_FILEINFO structure definition
    //
    typedef struct tagFILEINFO
    {
    unsigned long ulID; //File ID.
    unsigned long ulFlags; //Reserved.MUST be zero
    unsigned long ulFileSize;
    unsigned char ucFileType;
    unsigned char ucReadAccess;
    unsigned char ucWriteAccess;
    unsigned char ucCryptAccess;
    unsigned char ucReserved1[12];
    unsigned char ucGrantedAccess;
    unsigned char ucReserved2[15];
    }EPAS_FILEINFO, *PEPAS_FILEINFO;

    /////
    //// FILEINFO.FileType
    /// File type definition
    //
    #define EPAS_FILETYPE_UNUSED 0x00
    #define EPAS_FILETYPE_DIR 0x01
    #define EPAS_FILETYPE_DATA 0x02
    #define EPAS_FILETYPE_KEY 0x04
    #define EPAS_FILETYPE_UNKNOWN 0xFF

    /////
    //// FILEINFO.ReadAccess,FILEINFO.WriteAccess,FILEINFO.CryptAccess
    /// File access types
    //
    #define EPAS_ACCESS_ANYONE 0x00
    #define EPAS_ACCESS_USER 0x01
    #define EPAS_ACCESS_OFFICER 0x02
    #define EPAS_ACCESS_NONE 0x07

    ////
    /// FILEINFO.GrantedAccess
    //
    #define EPAS_ACCESS_READ 0x01
    #define EPAS_ACCESS_WRITE 0x02
    #define EPAS_ACCESS_CRYPT 0x04

    javascript也可以用这种方式将对象解释为结构:

    var FileType = {
                EPAS_FILETYPE_UNUSED: 0,
                EPAS_FILETYPE_DIR: 1,
                EPAS_FILETYPE_DATA: 2,
                EPAS_FILETYPE_KEY: 4,
                EPAS_FILETYPE_UNKNOWN: 0xFF
            };
    
            /////
            //// FILEINFO.ReadAccess,FILEINFO.WriteAccess,FILEINFO.CryptAccess
            /// File access types
            //
            var FileAccess = {
                EPAS_ACCESS_ANYONE: 0x00,
                EPAS_ACCESS_USER: 0x01,
                EPAS_ACCESS_OFFICER: 0x02,
                EPAS_ACCESS_NONE: 0x07
            }
    
            var GrantedAccess = {
                EPAS_ACCESS_READ: 0x01,
                EPAS_ACCESS_WRITE: 0x02,
                EPAS_ACCESS_CRYPT: 0x04
            }
    这样调用:
    ePass.CreateFile(0, 1, 16, FileType.EPAS_FILETYPE_KEY, FileAccess.EPAS_ACCESS_ANYONE, FileAccess.EPAS_ACCESS_ANYONE, FileAccess.EPAS_ACCESS_ANYONE, FileAccess.EPAS_ACCESS_ANYONE);
  • 相关阅读:
    开源框架.netCore DncZeus学习(五)下拉树的实现
    开源框架.netCore DncZeus学习(四)项目升级
    github下载更新代码到本地
    AndroidStudio替换空行
    Ext.net获取选中行数据
    OZCode
    禁止密码显示框
    Android layout_weight理解
    微信页面关于点击按钮关注公众号放到链接里无关注按钮
    进入页面就触发了popstate事件。
  • 原文地址:https://www.cnblogs.com/Sabre/p/3880382.html
Copyright © 2011-2022 走看看