PermissionSet 類別

定義

警告

Code Access Security is not supported or honored by the runtime.

代表可以包含許多不同類型權限的集合。

public ref class PermissionSet : System::Collections::ICollection, System::Runtime::Serialization::IDeserializationCallback, System::Security::ISecurityEncodable, System::Security::IStackWalk
public class PermissionSet : System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public class PermissionSet : System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk
[System.Serializable]
public class PermissionSet : System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class PermissionSet : System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk
type PermissionSet = class
    interface ICollection
    interface IEnumerable
    interface IDeserializationCallback
    interface ISecurityEncodable
    interface IStackWalk
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type PermissionSet = class
    interface ICollection
    interface IEnumerable
    interface IDeserializationCallback
    interface ISecurityEncodable
    interface IStackWalk
[<System.Serializable>]
type PermissionSet = class
    interface ISecurityEncodable
    interface ICollection
    interface IEnumerable
    interface IStackWalk
    interface IDeserializationCallback
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type PermissionSet = class
    interface ISecurityEncodable
    interface ICollection
    interface IEnumerable
    interface IStackWalk
    interface IDeserializationCallback
Public Class PermissionSet
Implements ICollection, IDeserializationCallback, ISecurityEncodable, IStackWalk
繼承
PermissionSet
衍生
屬性
實作

範例

下列程式碼範例示範類別和成員的使用 PermissionSet

// This sample demonstrates the use of the PermissionSet class.
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Permissions;
using namespace System::Security;
using namespace System::IO;
using namespace System::Collections;
void PermissionSetDemo()
{
   Console::WriteLine( "Executing PermissionSetDemo" );
   try
   {
      // Open a new PermissionSet.
      PermissionSet^ ps1 = gcnew PermissionSet( PermissionState::None );

      Console::WriteLine( "Adding permission to open a file from a file dialog box." );

      // Add a permission to the permission set.
      ps1->AddPermission( gcnew FileDialogPermission( FileDialogPermissionAccess::Open ) );

      Console::WriteLine( "Demanding permission to open a file." );
      ps1->Demand();
      Console::WriteLine( "Demand succeeded." );
      Console::WriteLine( "Adding permission to save a file from a file dialog box." );
      ps1->AddPermission( gcnew FileDialogPermission( FileDialogPermissionAccess::Save ) );
      Console::WriteLine( "Demanding permission to open and save a file." );
      ps1->Demand();
      Console::WriteLine( "Demand succeeded." );
      Console::WriteLine( "Adding permission to read environment variable USERNAME." );
      ps1->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"USERNAME" ) );
      ps1->Demand();
      Console::WriteLine( "Demand succeeded." );
      Console::WriteLine( "Adding permission to read environment variable COMPUTERNAME." );
      ps1->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"COMPUTERNAME" ) );

      // Demand all the permissions in the set.
      Console::WriteLine( "Demand all permissions." );
      ps1->Demand();

      Console::WriteLine( "Demand succeeded." );

      // Display the number of permissions in the set.
      Console::WriteLine( "Number of permissions = {0}", ps1->Count );

      // Display the value of the IsSynchronized property.
      Console::WriteLine( "IsSynchronized property = {0}", ps1->IsSynchronized );

      // Display the value of the IsReadOnly property.
      Console::WriteLine( "IsReadOnly property = {0}", ps1->IsReadOnly );

      // Display the value of the SyncRoot property.
      Console::WriteLine( "SyncRoot property = {0}", ps1->SyncRoot );

      // Display the result of a call to the ContainsNonCodeAccessPermissions method.
      // Gets a value indicating whether the PermissionSet contains permissions
      // that are not derived from CodeAccessPermission.
      // Returns true if the PermissionSet contains permissions that are not
      // derived from CodeAccessPermission; otherwise, false.
      Console::WriteLine( "ContainsNonCodeAccessPermissions method returned {0}", ps1->ContainsNonCodeAccessPermissions() );

      Console::WriteLine( "Value of the permission set ToString = \n{0}", ps1->ToString() );

      PermissionSet^ ps2 = gcnew PermissionSet( PermissionState::None );

      // Create a second permission set and compare it to the first permission set.
      ps2->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Read,"USERNAME" ) );
      ps2->AddPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::Write,"COMPUTERNAME" ) );
      IEnumerator^ list =  ps1->GetEnumerator();
      Console::WriteLine("Permissions in first permission set:");
            while (list->MoveNext())
                Console::WriteLine(list->Current->ToString());
      Console::WriteLine( "Second permission IsSubsetOf first permission = {0}", ps2->IsSubsetOf( ps1 ) );

      // Display the intersection of two permission sets.
      PermissionSet^ ps3 = ps2->Intersect( ps1 );
      Console::WriteLine( "The intersection of the first permission set and the second permission set = {0}", ps3 );

      // Create a new permission set.
      PermissionSet^ ps4 = gcnew PermissionSet( PermissionState::None );
      ps4->AddPermission( gcnew FileIOPermission( FileIOPermissionAccess::Read,"C:\\Temp\\Testfile.txt" ) );
      ps4->AddPermission( gcnew FileIOPermission( static_cast<FileIOPermissionAccess>(FileIOPermissionAccess::Read | FileIOPermissionAccess::Write | FileIOPermissionAccess::Append),"C:\\Temp\\Testfile.txt" ) );

      // Display the union of two permission sets.
      PermissionSet^ ps5 = ps3->Union( ps4 );
      Console::WriteLine( "The union of permission set 3 and permission set 4 = {0}", ps5 );

      // Remove FileIOPermission from the permission set.
      ps5->RemovePermission( FileIOPermission::typeid );
      Console::WriteLine( "The last permission set after removing FileIOPermission = {0}", ps5 );

      // Change the permission set using SetPermission.
      ps5->SetPermission( gcnew EnvironmentPermission( EnvironmentPermissionAccess::AllAccess,"USERNAME" ) );
      Console::WriteLine( "Permission set after SetPermission = {0}", ps5 );

      // Display result of ToXml and FromXml operations.
      PermissionSet^ ps6 = gcnew PermissionSet( PermissionState::None );
      ps6->FromXml( ps5->ToXml() );
      Console::WriteLine( "Result of ToFromXml = {0}\n", ps6 );

      // Display results of PermissionSet::GetEnumerator.
      IEnumerator^ psEnumerator = ps1->GetEnumerator();
      while ( psEnumerator->MoveNext() )
      {
         Console::WriteLine( psEnumerator->Current );
      }

      // Check for an unrestricted permission set.
      PermissionSet^ ps7 = gcnew PermissionSet( PermissionState::Unrestricted );
      Console::WriteLine( "Permission set is unrestricted = {0}", ps7->IsUnrestricted() );

      // Create and display a copy of a permission set.
      ps7 = ps5->Copy();
      Console::WriteLine( "Result of copy = {0}", ps7 );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( e->Message );
   }

}

int main()
{
   PermissionSetDemo();
}
// This sample demonstrates the use of the PermissionSet class.

using System;
using System.Reflection;
using System.Security.Permissions;
using System.Security;
using System.IO;
using System.Collections;

class MyClass
{
    public static void PermissionSetDemo()
    {
        Console.WriteLine("Executing PermissionSetDemo");
        try
        {
            // Open a new PermissionSet.
            PermissionSet ps1 = new PermissionSet(PermissionState.None);
            Console.WriteLine("Adding permission to open a file from a file dialog box.");
            // Add a permission to the permission set.
            ps1.AddPermission(
                new FileDialogPermission(FileDialogPermissionAccess.Open));
            Console.WriteLine("Demanding permission to open a file.");
            ps1.Demand();
            Console.WriteLine("Demand succeeded.");
            Console.WriteLine("Adding permission to save a file from a file dialog box.");
            ps1.AddPermission(
                new FileDialogPermission(FileDialogPermissionAccess.Save));
            Console.WriteLine("Demanding permission to open and save a file.");
            ps1.Demand();
            Console.WriteLine("Demand succeeded.");
            Console.WriteLine("Adding permission to read environment variable USERNAME.");
            ps1.AddPermission(
                new EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"));
            ps1.Demand();
            Console.WriteLine("Demand succeeded.");
            Console.WriteLine("Adding permission to read environment variable COMPUTERNAME.");
            ps1.AddPermission(
                new EnvironmentPermission(EnvironmentPermissionAccess.Read, "COMPUTERNAME"));
            // Demand all the permissions in the set.
            Console.WriteLine("Demand all permissions.");
            ps1.Demand();
            Console.WriteLine("Demand succeeded.");
            // Display the number of permissions in the set.
            Console.WriteLine("Number of permissions = " + ps1.Count);
            // Display the value of the IsSynchronized property.
            Console.WriteLine("IsSynchronized property = " + ps1.IsSynchronized);
            // Display the value of the IsReadOnly property.
            Console.WriteLine("IsReadOnly property = " + ps1.IsReadOnly);
            // Display the value of the SyncRoot property.
            Console.WriteLine("SyncRoot property = " + ps1.SyncRoot);
            // Display the result of a call to the ContainsNonCodeAccessPermissions method.
            // Gets a value indicating whether the PermissionSet contains permissions
            // that are not derived from CodeAccessPermission.
            // Returns true if the PermissionSet contains permissions that are not
            // derived from CodeAccessPermission; otherwise, false.
            Console.WriteLine("ContainsNonCodeAccessPermissions method returned " +
                ps1.ContainsNonCodeAccessPermissions());
            Console.WriteLine("Value of the permission set ToString = \n" + ps1.ToString());
            PermissionSet ps2 = new PermissionSet(PermissionState.None);
            // Create a second permission set and compare it to the first permission set.
            ps2.AddPermission(
                new EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"));
            ps2.AddPermission(
                new EnvironmentPermission(EnvironmentPermissionAccess.Write, "COMPUTERNAME"));
            IEnumerator list =  ps1.GetEnumerator();
            Console.WriteLine("Permissions in first permission set:");
            while (list.MoveNext())
                Console.WriteLine(list.Current.ToString());
            Console.WriteLine("Second permission IsSubsetOf first permission = " + ps2.IsSubsetOf(ps1));
            // Display the intersection of two permission sets.
            PermissionSet ps3 = ps2.Intersect(ps1);
            Console.WriteLine("The intersection of the first permission set and "
                + "the second permission set = " + ps3.ToString());
            // Create a new permission set.
            PermissionSet ps4 = new PermissionSet(PermissionState.None);
            ps4.AddPermission(
                new FileIOPermission(FileIOPermissionAccess.Read,
                "C:\\Temp\\Testfile.txt"));
            ps4.AddPermission(
                new FileIOPermission(FileIOPermissionAccess.Read |
                FileIOPermissionAccess.Write | FileIOPermissionAccess.Append,
                "C:\\Temp\\Testfile.txt"));
            // Display the union of two permission sets.
            PermissionSet ps5 = ps3.Union(ps4);
            Console.WriteLine("The union of permission set 3 and permission set 4 = "
                + ps5.ToString());
            // Remove FileIOPermission from the permission set.
            ps5.RemovePermission(typeof(FileIOPermission));
            Console.WriteLine("The last permission set after removing FileIOPermission = "
                + ps5.ToString());
            // Change the permission set using SetPermission.
            ps5.SetPermission(new EnvironmentPermission(EnvironmentPermissionAccess.AllAccess, "USERNAME"));
            Console.WriteLine("Permission set after SetPermission = " + ps5.ToString());
            // Display result of ToXml and FromXml operations.
            PermissionSet ps6 = new PermissionSet(PermissionState.None);
            ps6.FromXml(ps5.ToXml());
            Console.WriteLine("Result of ToFromXml = " + ps6.ToString() + "\n");
            // Display results of PermissionSet.GetEnumerator.
            IEnumerator psEnumerator = ps1.GetEnumerator();
            while (psEnumerator.MoveNext())
            {
                Console.WriteLine(psEnumerator.Current);
            }
            // Check for an unrestricted permission set.
            PermissionSet ps7 = new PermissionSet(PermissionState.Unrestricted);
            Console.WriteLine("Permission set is unrestricted = " + ps7.IsUnrestricted());
            // Create and display a copy of a permission set.
            ps7 = ps5.Copy();
            Console.WriteLine("Result of copy = " + ps7.ToString());
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message.ToString());
        }
    }

    static void Main(string[] args)
    {
        PermissionSetDemo();
    }
}
' This sample demonstrates the use of the PermissionSet class.
Imports System.Reflection
Imports System.Security.Permissions
Imports System.Security
Imports System.IO
Imports System.Collections

Class [MyClass]

    Public Shared Sub PermissionSetDemo()
        Console.WriteLine("Executing PermissionSetDemo")
        Try
            ' Open a new PermissionSet.
            Dim ps1 As New PermissionSet(PermissionState.None)
            Console.WriteLine("Adding permission to open a file from a file dialog box.")
            ' Add a permission to the permission set.
            ps1.AddPermission(New FileDialogPermission(FileDialogPermissionAccess.Open))
            Console.WriteLine("Demanding permission to open a file.")
            ps1.Demand()
            Console.WriteLine("Demand succeeded.")
            Console.WriteLine("Adding permission to save a file from a file dialog box.")
            ps1.AddPermission(New FileDialogPermission(FileDialogPermissionAccess.Save))
            Console.WriteLine("Demanding permission to open and save a file.")
            ps1.Demand()
            Console.WriteLine("Demand succeeded.")
            Console.WriteLine("Adding permission to read environment variable USERNAME.")
            ps1.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"))
            ps1.Demand()
            Console.WriteLine("Demand succeeded.")
            Console.WriteLine("Adding permission to read environment variable COMPUTERNAME.")
            ps1.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "COMPUTERNAME"))
            ' Demand all the permissions in the set.
            Console.WriteLine("Demand all permissions.")
            ps1.Demand()
            Console.WriteLine("Demand succeeded.")
            ' Display the number of permissions in the set.
            Console.WriteLine("Number of permissions = " & ps1.Count)
            ' Display the value of the IsSynchronized property.
            Console.WriteLine("IsSynchronized property = " & ps1.IsSynchronized)
            ' Display the value of the IsReadOnly property.
            Console.WriteLine("IsReadOnly property = " & ps1.IsReadOnly)
            ' Display the value of the SyncRoot property.
            Console.WriteLine("SyncRoot property = " & CType(ps1.SyncRoot, PermissionSet).ToString())
            ' Display the result of a call to the ContainsNonCodeAccessPermissions method.
            ' Gets a value indicating whether the PermissionSet contains permissions 
            ' that are not derived from CodeAccessPermission.
            ' Returns true if the PermissionSet contains permissions that are not 
            ' derived from CodeAccessPermission; otherwise, false.
            Console.WriteLine("ContainsNonCodeAccessPermissions method returned " & ps1.ContainsNonCodeAccessPermissions())
            Console.WriteLine("Value of the permission set ToString = " & ControlChars.Lf & ps1.ToString())
            Dim ps2 As New PermissionSet(PermissionState.None)
            ' Create a second permission set and compare it to the first permission set.
            ps2.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Read, "USERNAME"))
            ps2.AddPermission(New EnvironmentPermission(EnvironmentPermissionAccess.Write, "COMPUTERNAME"))
            Console.WriteLine("Permissions in first permission set:")
            Dim list As IEnumerator = ps1.GetEnumerator()
            While list.MoveNext()
                Console.WriteLine(list.Current.ToString())
            End While
            Console.WriteLine("Second permission IsSubsetOf first permission = " & ps2.IsSubsetOf(ps1))
            ' Display the intersection of two permission sets.
            Dim ps3 As PermissionSet = ps2.Intersect(ps1)
            Console.WriteLine("The intersection of the first permission set and " & "the second permission set = " & ps3.ToString())
            ' Create a new permission set.
            Dim ps4 As New PermissionSet(PermissionState.None)
            ps4.AddPermission(New FileIOPermission(FileIOPermissionAccess.Read, "C:\Temp\Testfile.txt"))
            ps4.AddPermission(New FileIOPermission(FileIOPermissionAccess.Read Or FileIOPermissionAccess.Write Or FileIOPermissionAccess.Append, "C:\Temp\Testfile.txt"))
            ' Display the union of two permission sets.
            Dim ps5 As PermissionSet = ps3.Union(ps4)
            Console.WriteLine("The union of permission set 3 and permission set 4 = " & ps5.ToString())
            ' Remove FileIOPermission from the permission set.
            ps5.RemovePermission(GetType(FileIOPermission))
            Console.WriteLine("The last permission set after removing FileIOPermission = " & ps5.ToString())
            ' Change the permission set using SetPermission.
            ps5.SetPermission(New EnvironmentPermission(EnvironmentPermissionAccess.AllAccess, "USERNAME"))
            Console.WriteLine("Permission set after SetPermission = " & ps5.ToString())
            ' Display result of ToXml and FromXml operations.
            Dim ps6 As New PermissionSet(PermissionState.None)
            ps6.FromXml(ps5.ToXml())
            Console.WriteLine("Result of ToFromXml = " & ps6.ToString() & ControlChars.Lf)
            ' Display results of PermissionSet.GetEnumerator.
            Dim psEnumerator As IEnumerator = ps1.GetEnumerator()
            While psEnumerator.MoveNext()
                Console.WriteLine(psEnumerator.Current)
            End While
            ' Check for an unrestricted permission set.
            Dim ps7 As New PermissionSet(PermissionState.Unrestricted)
            Console.WriteLine("Permission set is unrestricted = " & ps7.IsUnrestricted())
            ' Create and display a copy of a permission set.
            ps7 = ps5.Copy()
            Console.WriteLine("Result of copy = " & ps7.ToString())
        Catch e As Exception
            Console.WriteLine(e.Message.ToString())
        End Try
    End Sub

    Overloads Shared Sub Main(ByVal args() As String)
        PermissionSetDemo()
    End Sub
End Class

備註

警告

程式碼存取安全性 (CAS) 在所有版本的 .NET Framework 和 .NET 中已被取代。 使用 CAS 相關 API 時,最新版本的 .NET 不會接受 CAS 批註,並產生錯誤。 開發人員應該尋求替代方式來完成安全性工作。

您可以使用 PermissionSet ,以群組的形式對數個不同的許可權執行作業。

建構函式

PermissionSet(PermissionSet)
已淘汰.

以取自 permSet 參數的初始值,初始化 PermissionSet 類別的新執行個體。

PermissionSet(PermissionState)
已淘汰.

使用指定的 PermissionSet 初始化 PermissionState 類別的新執行個體。

屬性

Count
已淘汰.

取得權限集合所包含的權限物件數目。

IsReadOnly
已淘汰.

取得值,表示集合是否為唯讀。

IsSynchronized
已淘汰.

取得值,指出是否保證集合為安全執行緒。

SyncRoot
已淘汰.

取得目前集合的根物件。

方法

AddPermission(IPermission)
已淘汰.

將指定的權限加入 PermissionSet

AddPermissionImpl(IPermission)
已淘汰.

將指定的權限加入 PermissionSet

Assert()
已淘汰.

宣告即使堆疊中較高層的呼叫端未獲得資源存取權限,呼叫程式碼仍可透過呼叫這個方法的程式碼要求權限,來存取受保護的資源。 使用 Assert() 會造成安全性弱點。

ContainsNonCodeAccessPermissions()
已淘汰.

取得值,表示 PermissionSet 是否包含非衍生自 CodeAccessPermission 的權限。

ConvertPermissionSet(String, Byte[], String)
已淘汰.
已淘汰.

將編碼的 PermissionSet 從一種 XML 編碼格式轉換到另一種 XML 編碼格式。

Copy()
已淘汰.

建立 PermissionSet 的複本。

CopyTo(Array, Int32)
已淘汰.

將集合的權限物件複製到 Array 中的指定位置。

Demand()
已淘汰.

如果在呼叫堆疊中較高的所有呼叫端都尚未被授與由目前執行個體所指定之權限,則會在執行階段強制執行 SecurityException

Deny()
已淘汰.
已淘汰.

會讓任何通過權限呼叫程式碼的 Demand() 失敗,該權限與目前 PermissionSet 中包含的權限類型有交集。

Equals(Object)
已淘汰.

判斷指定的 PermissionSetNamedPermissionSet 物件是否等於目前的 PermissionSet

Equals(Object)
已淘汰.

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
FromXml(SecurityElement)
已淘汰.

透過 XML 編碼,重新建構具有指定狀態的安全性物件。

GetEnumerator()
已淘汰.

傳回此集合權限的列舉值。

GetEnumeratorImpl()
已淘汰.

傳回此集合權限的列舉值。

GetHashCode()
已淘汰.

取得 PermissionSet 物件的雜湊碼,其適合用於雜湊表這類的雜湊演算法和資料結構。

GetHashCode()
已淘汰.

做為預設雜湊函式。

(繼承來源 Object)
GetPermission(Type)
已淘汰.

如果它存在此集合中,則取得指定類型的使用權限物件。

GetPermissionImpl(Type)
已淘汰.

如果它存在此集合中,則取得指定類型的使用權限物件。

GetType()
已淘汰.

取得目前執行個體的 Type

(繼承來源 Object)
Intersect(PermissionSet)
已淘汰.

建立並傳回目前 PermissionSet 與指定 PermissionSet 交集的權限集。

IsEmpty()
已淘汰.

取得值,指出 PermissionSet 是否為空的。

IsSubsetOf(PermissionSet)
已淘汰.

判斷目前的 PermissionSet 是否為指定 PermissionSet 的子集。

IsUnrestricted()
已淘汰.

判斷 PermissionSet 是否為 Unrestricted

MemberwiseClone()
已淘汰.

建立目前 Object 的淺層複製。

(繼承來源 Object)
PermitOnly()
已淘汰.

會讓透過非目前 PermissionSet 子集的任何 PermissionSet 呼叫程式碼傳遞之任何 Demand() 失敗。

RemovePermission(Type)
已淘汰.

從集合中移除特定類型的權限。

RemovePermissionImpl(Type)
已淘汰.

從集合中移除特定類型的權限。

RevertAssert()
已淘汰.

會移除目前畫面格之任何先前的 Assert(),且不再有作用。

SetPermission(IPermission)
已淘汰.

將權限設定為 PermissionSet,以取代任何相同類型的現有權限。

SetPermissionImpl(IPermission)
已淘汰.

將權限設定為 PermissionSet,以取代任何相同類型的現有權限。

ToString()
已淘汰.

傳回 PermissionSet 的字串表示。

ToXml()
已淘汰.

建立安全物件及其目前狀態的 XML 編碼方式。

Union(PermissionSet)
已淘汰.

建立目前 PermissionSet 與指定 PermissionSet 聯集的 PermissionSet

明確介面實作

IDeserializationCallback.OnDeserialization(Object)
已淘汰.

執行於整個物件 Graph 已經還原序列化時。

擴充方法

Cast<TResult>(IEnumerable)
已淘汰.

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)
已淘汰.

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)
已淘汰.

啟用查詢的平行化作業。

AsQueryable(IEnumerable)
已淘汰.

IEnumerable 轉換成 IQueryable

適用於