081222 installshield脚本获取本机mac地址

本文介绍了一种使用C/C++语言生成GUID并将其转换为字符串的方法。通过调用UuidCreateSequential函数创建GUID,并利用Sprintf函数将GUID的组成部分转换为十六进制字符串形式。文章还展示了如何将各部分字符串拼接成完整的GUID字符串。

typedef GUID
begin
    long  Data1;
     short Data2;
      short Data3;
    char  c1;
    char  c2;
    char  c3;
    char  c4;
    char  c5;
    char  c6;
    char  c7;
    char  c8;
end;
prototype rpcrt4.UuidCreateSequential(pointer);

 

 

function OnFirstUIBefore()
    number  nResult;
    string  szTitle, szMsg;
    string  szLicenseFile, szQuestion;
    string  szDir;                               
    GUID  uid;
    string  strGUID;
    string   strTmp;            
    char    ca;
begin 
    // TO DO: if you want to enable background, window title, and caption bar title                                                                    
    // SetTitle( @TITLE_MAIN, 24, WHITE );                                       
    // SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION );                    
    // Enable( FULLWINDOWMODE );        
    // Enable( BACKGROUND );        
    // SetColor( BACKGROUND, RGB( 0, 128, 128 ) );       

UuidCreateSequential( &uid );
 
Sprintf( strTmp, "%02lx", uid.c3 );
strGUID = strGUID + strTmp;
Sprintf( strTmp, "%02lx", uid.c4 );
strGUID = strGUID + strTmp;
Sprintf( strTmp, "%02lx", uid.c5 );
strGUID = strGUID + strTmp;
Sprintf( strTmp, "%02lx", uid.c6 );
strGUID = strGUID + strTmp;
Sprintf( strTmp, "%02lx", uid.c7 );
strGUID = strGUID + strTmp;
Sprintf( strTmp, "%02lx", uid.c8 );
strGUID = strGUID + strTmp;  
 
SprintfBox( MB_OKCANCEL, "haha", "%s", strGUID );

end;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值