Visual Basic (Declaration) | |
---|---|
Public Overloads Sub CopyTo( _ ByVal target As String, _ ByVal replace As Boolean _ ) |
Parameters
- target
- replace
Library/Library.Test/TestTempFiles.cs
C# | Copy Code |
---|---|
TempFile filea = new TempFile(); File.WriteAllText(filea.TempPath, "Test"); Assert.AreEqual("Test", File.ReadAllText(filea.TempPath)); TempFile fileb = new TempFile(); Assert.AreNotEqual(filea.TempPath, fileb.TempPath); filea.CopyTo(fileb.TempPath, true); Assert.AreEqual("Test", File.ReadAllText(fileb.TempPath)); File.Delete(filea.TempPath); Assert.IsFalse(File.Exists(filea.TempPath)); fileb.CopyTo(filea.TempPath); Assert.AreEqual("Test", File.ReadAllText(filea.TempPath)); filea.Dispose(); fileb.Dispose(); |
VB.NET | Copy Code |
---|---|
Dim filea As New TempFile() File.WriteAllText(filea.TempPath, "Test") Assert.AreEqual("Test", File.ReadAllText(filea.TempPath)) Dim fileb As New TempFile() Assert.AreNotEqual(filea.TempPath, fileb.TempPath) filea.CopyTo(fileb.TempPath, True) Assert.AreEqual("Test", File.ReadAllText(fileb.TempPath)) File.Delete(filea.TempPath) Assert.IsFalse(File.Exists(filea.TempPath)) fileb.CopyTo(filea.TempPath) Assert.AreEqual("Test", File.ReadAllText(filea.TempPath)) filea.Dispose() fileb.Dispose() |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
TempFile ClassTempFile Members
Overload List