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