Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / HttpFileCollection.cs / 1 / HttpFileCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * Collection of posted files for the request intrinsic * * Copyright (c) 1998 Microsoft Corporation */ namespace System.Web { using System.Runtime.InteropServices; using System.Collections; using System.Collections.Specialized; using System.Security.Permissions; using System.Web.Util; ////// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class HttpFileCollection : NameObjectCollectionBase { // cached All[] arrays private HttpPostedFile[] _all; private String[] _allKeys; internal HttpFileCollection() : base(Misc.CaseInsensitiveInvariantKeyComparer) { } ////// Accesses incoming files uploaded by a client (using /// multipart MIME and the Http Content-Type of multipart/formdata). /// ////// public void CopyTo(Array dest, int index) { if (_all == null) { int n = Count; _all = new HttpPostedFile[n]; for (int i = 0; i < n; i++) _all[i] = Get(i); } if (_all != null) { _all.CopyTo(dest, index); } } internal void AddFile(String key, HttpPostedFile file) { _all = null; _allKeys = null; BaseAdd(key, file); } #if UNUSED internal void Reset() { _all = null; _allKeys = null; BaseClear(); } #endif // // Access by name // ///[To be supplied.] ////// public HttpPostedFile Get(String name) { return(HttpPostedFile)BaseGet(name); } ////// Returns a file from /// the collection by file name. /// ////// public HttpPostedFile this[String name] { get { return Get(name);} } // // Indexed access // ///Returns item value from collection. ////// public HttpPostedFile Get(int index) { return(HttpPostedFile)BaseGet(index); } ////// Returns a file from /// the file collection by index. /// ////// public String GetKey(int index) { return BaseGetKey(index); } ////// Returns key name from collection. /// ////// public HttpPostedFile this[int index] { get { return Get(index);} } // // Access to keys and values as arrays // ////// Returns an /// item from the collection. /// ////// public String[] AllKeys { get { if (_allKeys == null) _allKeys = BaseGetAllKeys(); return _allKeys; } } } }/// Creates an /// array of keys in the collection. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListDictionaryInternal.cs
- TrustManagerPromptUI.cs
- ComEventsMethod.cs
- ItemCheckEvent.cs
- ProfilePropertySettingsCollection.cs
- XmlReflectionMember.cs
- UnmanagedMemoryStream.cs
- OdbcInfoMessageEvent.cs
- SmtpFailedRecipientsException.cs
- NativeMethodsOther.cs
- ObjectStateEntry.cs
- StackSpiller.Temps.cs
- Zone.cs
- ExtenderHelpers.cs
- RequestUriProcessor.cs
- InsufficientExecutionStackException.cs
- CounterCreationDataCollection.cs
- FillBehavior.cs
- SqlHelper.cs
- Region.cs
- XmlSchemaInferenceException.cs
- PointCollection.cs
- DataBindingCollection.cs
- ConstantProjectedSlot.cs
- RepeaterItemEventArgs.cs
- TextViewBase.cs
- DesignerRegionCollection.cs
- XmlFormatWriterGenerator.cs
- ConfigurationLoader.cs
- UpdateProgress.cs
- LambdaCompiler.Generated.cs
- TrustManagerPromptUI.cs
- VideoDrawing.cs
- ColorTransformHelper.cs
- UIAgentMonitor.cs
- InvalidWMPVersionException.cs
- SiteMapNodeCollection.cs
- SqlDataSource.cs
- ViewSimplifier.cs
- BridgeDataReader.cs
- NumberSubstitution.cs
- BindableTemplateBuilder.cs
- IIS7UserPrincipal.cs
- SpinLock.cs
- DesignerProperties.cs
- BlurEffect.cs
- QueryContext.cs
- ContractAdapter.cs
- DesignerLoader.cs
- WinEventTracker.cs
- CqlErrorHelper.cs
- ValueProviderWrapper.cs
- CfgSemanticTag.cs
- SimplePropertyEntry.cs
- AttributedMetaModel.cs
- WindowsEditBox.cs
- mactripleDES.cs
- EventLogPermissionEntryCollection.cs
- ThreadStaticAttribute.cs
- OleStrCAMarshaler.cs
- TextServicesCompartmentContext.cs
- ListViewCancelEventArgs.cs
- TextTreeUndo.cs
- DetailsViewUpdateEventArgs.cs
- RenderCapability.cs
- Int64Converter.cs
- BindingExpressionUncommonField.cs
- TransformerConfigurationWizardBase.cs
- LogRecordSequence.cs
- TextRangeEdit.cs
- ContractCodeDomInfo.cs
- DataGridCell.cs
- HScrollProperties.cs
- cache.cs
- DesignerExtenders.cs
- DeploymentSectionCache.cs
- AnnotationComponentChooser.cs
- PrtCap_Base.cs
- VectorCollection.cs
- WrapPanel.cs
- AppSettingsExpressionBuilder.cs
- DropShadowEffect.cs
- MappingSource.cs
- TraceHandler.cs
- StructuredTypeEmitter.cs
- JournalNavigationScope.cs
- PlatformNotSupportedException.cs
- SqlClientFactory.cs
- KeyPressEvent.cs
- XmlNodeList.cs
- SymbolEqualComparer.cs
- HtmlMeta.cs
- HostElement.cs
- ResourceIDHelper.cs
- WebPartTransformer.cs
- objectresult_tresulttype.cs
- IntSecurity.cs
- DataGridItem.cs
- CodeIndexerExpression.cs
- WriteStateInfoBase.cs