掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Function の使い方 (ID:37771)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
マックアドレス取得方法を調べていたら以下のような方法を発見したのですが使用方法がわかりません、Functionとなっているのですがコレを用いFORM1のEdit1の中に代入したいと思います。 方法を教えていただきたいです。 Uses Winsock; Function SendARP (DestIp: DWORD; srcIP: DWORD; pMacAddr: pointer; PhyAddrLen: Pointer): DWORD;stdcall; external 'iphlpapi.dll'; Function getRemoteMacAdress (var address: String): Boolean; var dwRemoteIP: DWORD; PhyAddrLen: Longword; pMacAddr : array [0..1] of Longword; temp: array [0..5] of byte; I: Byte; begin Result := false; dwremoteIP := inet_addr (@address[1]); if dwremoteIP <> 0 then begin PhyAddrLen := 6; if SendARP (dwremoteIP, 0, @pMacAddr, @PhyAddrLen) = NO_ERROR then begin if (PhyAddrLen <> 0) and (pMacAddr[0] <> 0) then begin Move (pMacAddr, temp, 6); address := ''; For I := 0 to 5 do address := address + inttohex (temp[i], 2)+'-'; Delete (address, Length (address), 1); Result := true; end; end; end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.