CSharpTest.Net
Detatch Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > TempFile Class : Detatch Method

Glossary Item Box

Detatches this instance from the temporary file and returns the temp file's path

Syntax

Visual Basic (Declaration) 
Public Function Detatch() As String
C# 
public string Detatch()

Example

Library/Library.Test/TestTempFiles.cs

C#Copy Code
TempFile filea = new TempFile();
string path = filea.TempPath;
Assert.IsTrue(File.Exists(path));

Assert.AreEqual(path, filea.Detatch());
Assert.IsTrue(File.Exists(path));
filea.Dispose();
Assert.IsTrue(File.Exists(path));

File.Delete(path);
VB.NETCopy Code
Dim filea As New TempFile()
Dim path As String = filea.TempPath
Assert.IsTrue(File.Exists(path))

Assert.AreEqual(path, filea.Detatch())
Assert.IsTrue(File.Exists(path))
filea.Dispose()
Assert.IsTrue(File.Exists(path))

File.Delete(path)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys