FrameworkName.Inequality(FrameworkName, FrameworkName) 연산자

정의

FrameworkName 개체가 다른 .NET Framework 버전을 표시하는지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether two FrameworkName objects represent different .NET Framework versions.

public:
 static bool operator !=(System::Runtime::Versioning::FrameworkName ^ left, System::Runtime::Versioning::FrameworkName ^ right);
public static bool operator != (System.Runtime.Versioning.FrameworkName left, System.Runtime.Versioning.FrameworkName right);
static member op_Inequality : System.Runtime.Versioning.FrameworkName * System.Runtime.Versioning.FrameworkName -> bool
Public Shared Operator != (left As FrameworkName, right As FrameworkName) As Boolean

매개 변수

left
FrameworkName

비교할 첫 번째 개체입니다.The first object to compare.

right
FrameworkName

비교할 두 번째 개체입니다.The second object to compare.

반환

Boolean

leftright 매개 변수가 다른 .NET Framework 버전을 표시하면 true이고, 그렇지 않으면 false입니다.true if the left and right parameters represent different .NET Framework versions; otherwise, false.

예제

다음 예에서는 같음 연산자를 사용 하 여 .NET Framework 실행 중인 버전을 나타내는 FrameworkName 개체가 지원 되는 버전의 .NET Framework와 같은지 여부를 확인 합니다.The following example uses the equality operator to determine whether a FrameworkName object that represents the running version of the .NET Framework is equal to a supported version of the .NET Framework. 동일한 버전 번호 없기 때문에 두 버전이 같지 않은지를 참고 합니다.Note that the two versions are not equal because they do not have identical version numbers.

FrameworkName supportedVer1 = new FrameworkName(".NET Framework, Version=4.0");
FrameworkName actualVersion = new FrameworkName(String.Format(
                                           ".NET Framework, Version={0}", 
                                           Environment.Version.ToString()));
                                           
Console.WriteLine("Supported Version: {0}", supportedVer1);
Console.WriteLine("Actual Version:    {0}", actualVersion);
if (supportedVer1 != actualVersion)    
   Console.WriteLine("The supported and actual Framework versions are different.");
else
   Console.WriteLine("The supported and actual Framework versions are the same.");

Console.WriteLine();
// The example displays the following output:
//       The supported and actual Framework versions are different.       
Dim supportedVer1 As New FrameworkName(".NET Framework, Version=4.0")
Dim actualVersion As New FrameworkName(String.Format(".NET Framework, Version={0}", 
                                       Environment.Version.ToString())) 

Console.WriteLine("Supported Version: {0}", supportedVer1)
Console.WriteLine("Actual Version:    {0}", actualVersion)
If supportedVer1 <> actualVersion Then
   Console.WriteLine("The supported and actual Framework versions are different.")
Else
   Console.WriteLine("The supported and actual Framework versions are the same.")
End If 
Console.WriteLine()
' The example displays the following output:
'      Supported Version: .NET Framework,Version=v4.0
'      Actual Version:    .NET Framework,Version=v4.0.30319.18010
'      The supported and actual Framework versions are different.

설명

Inequality 메서드는 FrameworkName 개체에 대 한 같지 않음 연산자의 연산을 정의 합니다.The Inequality method defines the operation of the inequality operator for FrameworkName objects.

사용자 지정 연산자를 지원 하지 않는 언어는 FrameworkName.Equals(FrameworkName) 메서드를 호출 하 고 값을 반대로 하 여 같지 않은지 테스트할 수 있습니다.Languages that do not support custom operators can test for inequality by calling the FrameworkName.Equals(FrameworkName) method and reversing its value.

적용 대상