Freigeben über


HttpRequest.Files-Eigenschaft

Ruft die Auflistung der Clientuploaddateien im MIME-Multipart-Format ab.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

Syntax

'Declaration
Public ReadOnly Property Files As HttpFileCollection
'Usage
Dim instance As HttpRequest
Dim value As HttpFileCollection

value = instance.Files
public HttpFileCollection Files { get; }
public:
property HttpFileCollection^ Files {
    HttpFileCollection^ get ();
}
/** @property */
public HttpFileCollection get_Files ()
public function get Files () : HttpFileCollection

Eigenschaftenwert

Ein HttpFileCollection-Objekt, das eine Auflistung von Clientuploaddateien darstellt.

Hinweise

Die Dateiauflistung wird nur aufgefüllt, wenn der Content-Type-Wert der HTTP-Anforderung "multipart/form-data" ist.

Beispiel

Im folgenden Codebeispiel werden die Namen aller Dateien in der Files-Auflistung angezeigt.

Dim loop1 As Integer
 Dim arr1() As String
 Dim Files As HttpFileCollection
 
 Files = Request.Files ' Load File collection into HttpFileCollection variable.
 arr1 = Files.AllKeys ' This will get names of all files into a string array.
 for loop1 = 0 To arr1.GetUpperBound(0)
    Response.Write("File: " & Server.HtmlEncode(arr1(loop1)) & "<br>")
 Next loop1
   
int loop1;
HttpFileCollection Files;
 
Files = Request.Files; // Load File collection into HttpFileCollection variable.
arr1 = Files.AllKeys;  // This will get names of all files into a string array.
for (loop1 = 0; loop1 < arr1.Length; loop1++) 
{
   Response.Write("File: " + Server.HtmlEncode(arr1[loop1]) + "<br>");
}
   
int loop1;
HttpFileCollection files;        
files = get_Request().get_Files(); // Load File collection into
                                   // HttpFileCollection variable.
arr1 = files.get_AllKeys(); // This will get names of all files into
                            // a string array.
for (loop1 = 0; loop1 < arr1.length; loop1++) {
    get_Response().Write(("File: "
        + get_Server().HtmlEncode(arr1[loop1]) + "<br>"));
}
var files : HttpFileCollection = Request.Files  // Load File collection into HttpFileCollection variable.
var arr1 : String[] = files.AllKeys             // This will get names of all files into a string array.
for(var loop1 = 0; loop1 < arr1.Length; loop1++){
  Response.Write("File: " + Server.HtmlEncode(arr1[loop1]) + "<br>")
}
   

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

HttpRequest-Klasse
HttpRequest-Member
System.Web-Namespace