OutputCacheProfileCollection.Add(OutputCacheProfile) 메서드

정의

컬렉션에 OutputCacheProfile 개체를 추가합니다.

public:
 void Add(System::Web::Configuration::OutputCacheProfile ^ name);
public void Add(System.Web.Configuration.OutputCacheProfile name);
member this.Add : System.Web.Configuration.OutputCacheProfile -> unit
Public Sub Add (name As OutputCacheProfile)

매개 변수

name
OutputCacheProfile

컬렉션에 OutputCacheProfile 추가할 개체의 이름입니다.

예외

개체가 OutputCacheProfile 컬렉션에 이미 있거나 컬렉션이 읽기 전용입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 있습니다 Add .

// Execute the Add method.
System.Web.Configuration.OutputCacheProfile outputCacheProfile0 =
  new System.Web.Configuration.OutputCacheProfile("MyCacheProfile");
outputCacheProfile0.Location = 
    System.Web.UI.OutputCacheLocation.Any;
outputCacheProfile0.NoStore = false;

outputCacheProfiles.Add(outputCacheProfile0);

// Update if not locked.
if (!outputCacheSettings.IsReadOnly())
{
    webConfig.Save();
}
' Execute the Add method.
  Dim outputCacheProfile0 _
  As New System.Web.Configuration.OutputCacheProfile( _
  "MyCacheProfile")
  outputCacheProfile0.Location = _
  System.Web.UI.OutputCacheLocation.Any
  outputCacheProfile0.NoStore = _
  False

  outputCacheProfiles.Add(outputCacheProfile0)

' Update if not locked.
  If Not outputCacheSettings.IsReadOnly() Then
      webConfig.Save()
  End If

설명

컬렉션에 이름이 같은 개체를 OutputCacheProfile 포함할 수 없습니다.

적용 대상

추가 정보