CSharpTest.Net
TempFile Constructor()
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > TempFile Class > TempFile Constructor : TempFile Constructor()

Glossary Item Box

Constructs a new temp file with a newly created/empty file.

Syntax

Visual Basic (Declaration) 
Public Function New()
C# 
public TempFile()

Example

Library/Library.Test/TestXhtmlValid.cs

C#Copy Code
string doc = @"<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">
<html>
    <head><title>required</title></head>
    <body><iframe></iframe></body>
</html>
";

XhtmlValidation v = new XhtmlValidation(XhtmlDTDSpecification.XhtmlTransitional_10);

using (TempFile temp = new TempFile())
{
    temp.WriteAllText(doc);
    v.Validate(@"C:\transitional.xhtml", new StreamReader(temp.Read()));
}
VB.NETCopy Code
Dim doc As String = "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">" & vbCr & vbLf & "            <html>" & vbCr & vbLf & "                <head><title>required</title></head>" & vbCr & vbLf & "                <body><iframe></iframe></body>" & vbCr & vbLf & "            </html>" & vbCr & vbLf & "            "

Dim v As New XhtmlValidation(XhtmlDTDSpecification.XhtmlTransitional_10)

Using temp As New TempFile()
    temp.WriteAllText(doc)
    v.Validate("C:\transitional.xhtml", New StreamReader(temp.Read()))
End Using

Requirements

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

See Also

Reference

TempFile Class
TempFile Members
Overload List

Used By

BasicTests.TestBulkInsert()
SampleCustomTypeTest.Setup()
TestBackupAndRecovery.TestRecoveryOnNewWithAsyncLog()
TestBackupAndRecovery.TestRestoreLargeLog()
TestBackupAndRecovery.TestRecoveryOnExistingWithAsyncLog()
TestBackupAndRecovery.TestRecoveryOnNew()
TestBackupAndRecovery.TestRecoveryOnExisting()
TestBackupAndRecovery.TestRecoveryOnNewLargeOrder()
TestBackupAndRecovery.TestRecoveryOnExistingLargeOrder()
TestBPlusTreeOptions.TestReadOnly()
BasicFileTests.Setup()
BPlusTree TestFileSerialized.BTreeFactory.Create()
BPlusTree DictionaryTestsVersion2.BTreeFactory.Create()
TestBulkInsert.TestMergeSequenceInFile()
TestBulkInsert.TestMergeRandomInFile()
TestMultiInstance.TestReadOnlyCopy()
TestMultiInstance.TestSyncFromLogging()
TestTransactionLog.TestTransactionLogOptions()
TestTransactionLog.TestAddOperation()
TestTransactionLog.TestUpdateOperation()
TestTransactionLog.TestRemoveOperation()
TestTransactionLog.TestMultipleWriteAndReplay()
TestTransactionLog.TestMultipleTransAndReplay()
TestTransactionLog.TestLargeWriteAndReplay()
TestTransactionLog.TestProgressiveReplay()
TestTransactionLog.TestSingleRollbackAndReplay()
TestTransactionLog.TestPositionAndReplay()
TestTransactionLog.TestCommitEmptyAndReplay()
TestTransactionLog.TestReplayEmpty()
TestTransactionLog.TestTruncateLog()
TestTransactionLog.TestLogWithJunkAppended()
TestTransactionLog.TestLogCorruption()
ThreadedBTreeTest.Setup()
ThreadedBTreeTest.TestAbortWritersAndRecover()
ThreadedMassInsertTest.TestConcurrency()
XhtmlValidation.Validate(TextReader)

Source Code

Library/IO/TempFile.cs

Generated with Document! X 2011 by Innovasys