共用方式為


ZipArchive Constructor (String)

Opens a ZipArchive on the specified path for reading. The specified file is opened with FileMode.Open.

Namespace:  Microsoft.TeamFoundation.Server.Core
Assembly:  Microsoft.TeamFoundation.Server.Core (in Microsoft.TeamFoundation.Server.Core.dll)

Syntax

'Declaration
Public Sub New ( _
    archiveFileName As String _
)
public ZipArchive(
    string archiveFileName
)
public:
ZipArchive(
    String^ archiveFileName
)
new : 
        archiveFileName:string -> ZipArchive
public function ZipArchive(
    archiveFileName : String
)

Parameters

  • archiveFileName
    Type: System.String

    A string specifying the path on the filesystem to open the archive on. The path is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.

Exceptions

Exception Condition
ArgumentException

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by InvalidPathChars.

ArgumentNullException

path is null.

PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

DirectoryNotFoundException

The specified path is invalid, (for example, it is on an unmapped drive).

IOException

An I/O error occurred while opening the file.

UnauthorizedAccessException

path specified a directory. -or- The caller does not have the required permission.

FileNotFoundException

The file specified in path was not found.

NotSupportedException

path is in an invalid format.

InvalidDataException

The specified file could not be interpreted as a Zip file.

.NET Framework Security

See Also

Reference

ZipArchive Class

ZipArchive Overload

Microsoft.TeamFoundation.Server.Core Namespace