The FileName that this factory produces streams for
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property FileName As String |
C# | |
---|
public string FileName {get;} |
Example
Library/Library.Test/TestStreamCache.cs
C# | Copy Code |
---|
using(TempFile tempFile = new TempFile())
{
FileStreamFactory factory = new FileStreamFactory(tempFile.TempPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 1024, FileOptions.Asynchronous);
Assert.AreEqual(tempFile.TempPath, factory.FileName);
using (FileStream s = (FileStream)factory.Create())
Assert.IsTrue(s.CanRead && s.CanWrite && s.IsAsync);
} |
VB.NET | Copy Code |
---|
Using tempFile As New TempFile()
Dim factory As New FileStreamFactory(tempFile.TempPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 1024, FileOptions.Asynchronous)
Assert.AreEqual(tempFile.TempPath, factory.FileName)
Using s As FileStream = DirectCast(factory.Create(), FileStream)
Assert.IsTrue(s.CanRead AndAlso s.CanWrite AndAlso s.IsAsync)
End Using
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also