RouteCollection.SetItem(Int32, RouteBase) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取代位於指定索引處的路由。
protected:
override void SetItem(int index, System::Web::Routing::RouteBase ^ item);
protected override void SetItem(int index, System.Web.Routing.RouteBase item);
override this.SetItem : int * System.Web.Routing.RouteBase -> unit
Protected Overrides Sub SetItem (index As Integer, item As RouteBase)
參數
- index
- Int32
路線的零基索引要替換。
- item
- RouteBase
在指定索引處加入的路徑。
例外狀況
item 是 null。
item 已經在收藏中。
備註
當你在物件中新增未命名的路由 RouteCollection 時,你無法新增已經在集合中的路由。
善用這個 GetReadLock 方法和方法 GetWriteLock ,確保你與收藏互動時不會與其他流程產生衝突。