|
음 W7의 경우 쿼리에서 where절이 문제가 되는군요.
케이블 빠져있으면 ipenabled가 false로 되는 모양입니다.
SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True
에서 Where 절 이하를 생략하고 사용하니까 물리주소를 얻어올 수는 있군요.
저도 궁금하네요 님이 쓰신 글 :
: 저도 궁금해서 찾아봤는데
:
: void DisplayTypeAndAddress()
: {
: IPGlobalProperties* computerProperties = IPGlobalProperties::GetIPGlobalProperties();
: NetworkInterface* nics[] = NetworkInterface::GetAllNetworkInterfaces();
: Console::WriteLine(S"Interface information for {0}.{1} ",
: computerProperties->HostName, computerProperties->DomainName);
: System::Collections::IEnumerator* myEnum27 = nics->GetEnumerator();
: while (myEnum27->MoveNext())
: {
: NetworkInterface* adapter = __try_cast<NetworkInterface*>(myEnum27->Current);
: IPInterfaceProperties* properties = adapter->GetIPInterfaceProperties();
: Console::WriteLine(adapter->Description);
: Console::WriteLine(String::Empty->PadLeft(adapter->Description->Length,'='));
: Console::WriteLine(S" Interface type .......................... : {0}", __box(adapter->Type));
: Console::WriteLine(S" Physical Address ........................ : {0}",
: adapter->GetPhysicalAddress());
: Console::WriteLine(S" Is receive only.......................... : {0}", __box(adapter->IsReceiveOnly));
: Console::WriteLine(S" Multicast................................ : {0}", __box(adapter->SupportsMulticast));
: }
: }
:
: MSDN에서 찾은 이정도만 있네요.. WMI사용하는 방법이 대부분이구요
: 정 안되면 ipconfig에서 사용하는 API를 가져다 쓸수 있지 않을까 하는 생각도...
: 그런데 사용자 유니크 ID얻는 방법이 MAC+HDD가 최상인가요?
: 예전에 HDD는 사타,IDE,SCSI다 다른거 같던데요
:
: 바이오스 시리얼같은것도 생각해봅니다.
:
: 좋은 해결책이 나와서 다른 분들도 유용하게 사용했으면합니다.
:
: 새해 복많이 받으세요
:
:
: JBMEX 님이 쓰신 글 :
: : 물리적으로 케이블 빠져있으면 주소 추출이 잘 안되는 경우가 있습니다.
: : 그거 외에 안된다면 랜카드 바꿔야 하는 경우가 아닌가 싶습니다.
: :
: : 물리적으로 케이블이 빠져있어도 제대로 주소 추출하려면
: : WMI 스크립트 사용 추천합니다. Vista까지는 문제없이 작동했고요.
: : W7 부터는 버벅거리더군요. 9년정도 요긴하게 잘 써먹었는데
: : 저도 다른 방법을 찾아봐야 할 듯 합니다.
|