CookieCollection.Item[] Özellik

Tanım

bir içinden belirli Cookie bir CookieCollectionalır.

Aşırı Yüklemeler

Name Description
Item[Int32]

öğesini Cookie bir dizininden belirli bir CookieCollectiondizinle alır.

Item[String]

bir Cookie 'den CookieCollectionbelirli bir ada sahip olan öğesini alır.

Item[Int32]

Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs

öğesini Cookie bir dizininden belirli bir CookieCollectiondizinle alır.

public:
 property System::Net::Cookie ^ default[int] { System::Net::Cookie ^ get(int index); };
public System.Net.Cookie this[int index] { get; }
member this.Item(int) : System.Net.Cookie
Default Public ReadOnly Property Item(index As Integer) As Cookie

Parametreler

index
Int32

Bulunabilecek sıfır tabanlı dizini Cookie .

Özellik Değeri

bir Cookie dizininden belirli bir dizine sahip olan A CookieCollection.

Özel durumlar

index 0'dan küçük veya index değerinden büyük veya eşittir Count.

Örnekler

  // Get the cookies in the 'CookieCollection' object using the 'Item' property.
  // The 'Item' property in C# is implemented through Indexers.
// The class that implements indexers is usually a collection of other objects.
// This class provides access to those objects with the '<class-instance>[i]' syntax.
  try {
      if(cookies.Count == 0) {
          Console.WriteLine("No cookies to display");
          return;
      }
      for(int j = 0; j < cookies.Count; j++)
          Console.WriteLine("{0}", cookies[j].ToString());
      Console.WriteLine("");
  }
  catch(Exception e) {
      Console.WriteLine("Exception raised.\nError : " + e.Message);
  }
 'Get the cookies in the 'CookieCollection' object using the 'Item' property.
 Try
    If cookies.Count = 0 Then
        Console.WriteLine("No cookies to display")
        Return
    End If
    Dim j As Integer
    For j = 0 To cookies.Count - 1
        Console.WriteLine("{0}", cookies(j).ToString())
    Next j
    Console.WriteLine("")
Catch e As Exception
    Console.WriteLine(("Exception raised." + ControlChars.Cr + "Error : " + e.Message))
End Try

Açıklamalar

Bunu, içeriğini CookieCollectionyinelemek için kullanabilirsiniz.

Ayrıca bkz.

Şunlara uygulanır

Item[String]

Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs
Kaynak:
CookieCollection.cs

bir Cookie 'den CookieCollectionbelirli bir ada sahip olan öğesini alır.

public:
 property System::Net::Cookie ^ default[System::String ^] { System::Net::Cookie ^ get(System::String ^ name); };
public System.Net.Cookie this[string name] { get; }
public System.Net.Cookie? this[string name] { get; }
member this.Item(string) : System.Net.Cookie
Default Public ReadOnly Property Item(name As String) As Cookie

Parametreler

name
String

Bulunacak öğesinin Cookie adı.

Özellik Değeri

bir Cookie 'den CookieCollectionbelirli bir ada sahip olan.

Özel durumlar

name, null'e eşittir.

Örnekler

// Get the cookies in the 'CookieCollection' object using the 'Item' property.
// The 'Item' property in C# is implemented through Indexers.
// The class that implements indexers is usually a collection of other objects.
// This class provides access to those objects with the '<class-instance>[i]' syntax.
try {
    if(cookies.Count == 0) {
        Console.WriteLine("No cookies to display");
        return;
    }
    Console.WriteLine("{0}", cookies["UserName"].ToString());
    Console.WriteLine("{0}", cookies["DateOfBirth"].ToString());
    Console.WriteLine("{0}", cookies["PlaceOfBirth"].ToString());
    Console.WriteLine("");
}
catch(Exception e) {
    Console.WriteLine("Exception raised.\nError : " + e.Message);
}
' Get the cookies in the 'CookieCollection' object using the 'Item' property.


Try
    If cookies.Count = 0 Then
        Console.WriteLine("No cookies to display")
        Return
    End If
    Console.WriteLine("{0}", cookies("UserName").ToString())
    Console.WriteLine("{0}", cookies("DateOfBirth").ToString())
    Console.WriteLine("{0}", cookies("PlaceOfBirth").ToString())
    Console.WriteLine("")
Catch e As Exception
    Console.WriteLine(("Exception raised." + ControlChars.Cr + "Error : " + e.Message))
End Try

Açıklamalar

Bunu, içeriğini CookieCollectionyinelemek için kullanabilirsiniz.

Ayrıca bkz.

Şunlara uygulanır