VB輔導(dǎo):取得網(wǎng)卡序列號(hào)

字號(hào):

很多軟件以取得網(wǎng)卡地址作為license驗(yàn)證,這不失為一個(gè)驗(yàn)證合法用戶的好辦法,不過要付出回復(fù)用戶電話、傳真的代價(jià)哦 
    將下面這段代碼拷貝到程序中,然后在你的程序需要的時(shí)候調(diào)用ethernetaddress(0),該函數(shù)返回的字符串就是您機(jī)器上網(wǎng)卡的以太序列號(hào)。
    private const ncbastat = &h33
    private const ncbnamsz = 16
    private const heap_zero_memory = &h8
    private const heap_generate_exceptions = &h4
    private const ncbreset = &h32
    private type ncb
    ncb_command as byte
    ncb_retcode as byte
    ncb_lsn as byte
    ncb_num as byte
    ncb_buffer as long
    ncb_length as integer
    ncb_callname as string * ncbnamsz
    ncb_name as string * ncbnamsz
    ncb_rto as byte
    ncb_sto as byte
    ncb_post as long
    ncb_lana_num as byte
    ncb_cmd_cplt as byte
    ncb_reserve(9) as byte ’’ reserved, must be 0
    ncb_event as long
    end type