NetworkInformation.GetConnectionProfiles 메서드

정의

로컬 컴퓨터에서 활성 또는 기타 연결에 대한 프로필 목록을 가져옵니다.

public:
 static IVectorView<ConnectionProfile ^> ^ GetConnectionProfiles();
 static IVectorView<ConnectionProfile> GetConnectionProfiles();
public static IReadOnlyList<ConnectionProfile> GetConnectionProfiles();
function getConnectionProfiles()
Public Shared Function GetConnectionProfiles () As IReadOnlyList(Of ConnectionProfile)

반환

ConnectionProfile 개체의 배열입니다.

설명

다음 예제에서는 ConnectionProfile을 검색하는 방법을 보여 줍니다. 함수는 getConnectionProfiles 를 호출하여 디바이스에서 사용 가능한 모든 연결을 검색하고 목록을 사용하여 표시합니다. 또는 앱 에서 getInternetConnectionProfile 을 호출하여 현재 인터넷 연결에 사용되는 연결을 나타내는 ConnectionProfile 을 검색할 수 있습니다.

참고 아래 코드에서 getConnectionProfileInfo 메서드를 구현하고 연결 프로필을 검색하기 위해 NetworkInformation 클래스 메서드를 구현하는 방법에 대한 추가 예제는 빠른 시작: 네트워크 연결 정보 검색을 참조하세요.

function DisplayConnectionProfileList() {
    var profileList = "";
    var ConnectionProfiles = networkInfo.getConnectionProfiles();
        if (ConnectionProfiles.length !== 0) {
            for (var i = 0; i < ConnectionProfiles.length; i++) {

                //Display Connection profile info for each profile by passing it
																//to a function that accesses and displays the connection properties
                profileList += getConnectionProfileInfo(ConnectionProfiles[i]);
                profileList += "-------------------------\n\r";
            }
            mySample.displayStatus(profileList);
        }
        else {
            mySample.displayStatus("No profiles found");
        }
    }

    catch (e) {
        mySample.displayError("Exception Caught: " + e + "\n\r");
    }
}

적용 대상