![Copy image Copy image](copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Deployment Tools Foundation
OpenText Method (fileName)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.Compression ► ArchiveInfo ► OpenText(String)
Opens a file inside the archive for reading text with UTF-8 encoding
without actually extracting the file to disk.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ | F# |
public StreamReader OpenText( string fileName )
Public Function OpenText ( fileName As String ) As StreamReader
public: StreamReader^ OpenText( String^ fileName )
member OpenText : fileName : string -> StreamReader
![](collapse_all.gif)
- fileName (String)
- The name of the file in the archive. Also includes the internal path of the file, if any. File name matching is case-insensitive.
![](collapse_all.gif)
StreamReader
A reader for reading text directly from the packed file. Like any reader this should be closed/disposed as soon as it is no longer needed.
A reader for reading text directly from the packed file. Like any reader this should be closed/disposed as soon as it is no longer needed.
![](collapse_all.gif)
To open an archived text file with different encoding, use the
OpenRead(String) method and pass the returned stream to one of
the StreamReader constructor overloads.
Assembly: Microsoft.Deployment.Compression (Module: Microsoft.Deployment.Compression.dll) Version: 3.0.0.0 (3.11.1.2318)