2013. 6. 18. 17:45 IT
ASP MAC Address 알아내기 FROM TAEYO.NET.
mac address 에 대해서 질문좀할게요^^ | |
SEQ : 126278 | 글쓴이 : dark66 |
작성 포맷 :TEXT 모드, 자동 줄바꿈 사용 제가 스크랩해놓은.. Mac Address 알아내는 소스.. 자알 써먹으세요. ^^; (참고로 저도 안해봤음.. ㅎㅎ 테스트 하고 손좀 봐야 할터인데..) 내용은 Nbtstat를 이용하여 접속한 IP의 정보를 Text로 저장후 Text를 분석 strMac = GetMACAddress(Request.ServerVariables("REMOTE_ADDR")) function GetMACAddress(strIP) Set net = Server.CreateObject("wscript.network") Set sh = Server.CreateObject("wscript.shell") sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strIP & ".txt",0,true Set sh = nothing Set fso = createobject("scripting.filesystemobject") Set ts = fso.opentextfile("c:\" & strIP & ".txt") macaddress = null Do While Not ts.AtEndOfStream data = ucase(trim(ts.readline)) if instr(data,"MAC ADDRESS") Then macaddress = trim(split(data,"=")(1)) Exit Do End if loop ts.close Set ts = nothing fso.deletefile "c:\" & strIP & ".txt" Set fso = nothing GetMACAddress = macaddress End function |
mac address 에 대해서 질문좀할게요^^ | |
SEQ : 126278 | 글쓴이 : dark66 |
작성 포맷 :TEXT 모드, 자동 줄바꿈 사용 제가 스크랩해놓은.. Mac Address 알아내는 소스.. 자알 써먹으세요. ^^; (참고로 저도 안해봤음.. ㅎㅎ 테스트 하고 손좀 봐야 할터인데..) 내용은 Nbtstat를 이용하여 접속한 IP의 정보를 Text로 저장후 Text를 분석 strMac = GetMACAddress(Request.ServerVariables("REMOTE_ADDR")) function GetMACAddress(strIP) Set net = Server.CreateObject("wscript.network") Set sh = Server.CreateObject("wscript.shell") sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strIP & ".txt",0,true Set sh = nothing Set fso = createobject("scripting.filesystemobject") Set ts = fso.opentextfile("c:\" & strIP & ".txt") macaddress = null Do While Not ts.AtEndOfStream data = ucase(trim(ts.readline)) if instr(data,"MAC ADDRESS") Then macaddress = trim(split(data,"=")(1)) Exit Do End if loop ts.close Set ts = nothing fso.deletefile "c:\" & strIP & ".txt" Set fso = nothing GetMACAddress = macaddress End function |
http://www.taeyo.pe.kr/Forum/Content.aspx?SEQ=126278&TBL=ASP
제가 스크랩해놓은.. Mac Address 알아내는 소스.. 자알 써먹으세요. ^^;
(참고로 저도 안해봤음.. ㅎㅎ 테스트 하고 손좀 봐야 할터인데..)
내용은 Nbtstat를 이용하여 접속한 IP의 정보를 Text로 저장후 Text를 분석
strMac = GetMACAddress(Request.ServerVariables("REMOTE_ADDR"))
function GetMACAddress(strIP)
Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strIP & ".txt",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\" & strIP & ".txt")
macaddress = null
Do While Not ts.AtEndOfStream
data = ucase(trim(ts.readline))
if instr(data,"MAC ADDRESS") Then
macaddress = trim(split(data,"=")(1))
Exit Do
End if
loop
ts.close
Set ts = nothing
fso.deletefile "c:\" & strIP & ".txt"
Set fso = nothing
GetMACAddress = macaddress
End function
'IT' 카테고리의 다른 글
window.opener.location.reload, 웹 페이지를 다시 표시하려면 웹 브라우저에서 이전에 전송한 정보를 다시 전송해야 합니다. 라는 경고 발생 (0) | 2013.07.03 |
---|---|
IIS 7.0 에서 임의 폴더 서비스 제외. (0) | 2013.07.02 |
IIS ASP.NET 동작 에러 ( 500.21 ) (0) | 2013.05.30 |
SVN Hook command (0) | 2013.05.30 |
암호화/복호화 Component (0) | 2013.05.15 |