Copy

ComToolkit.IO.File.Copy(@"c:\AnyDir\AnyFile.ext", @"c:\AnyDir\AnyFile2.ext", true);

Create

AdoFileStream stream = ComToolkit.IO.File.Create(@"c:\AnyDir\AnyFile.ext");

Delete

ComToolkit.IO.File.Delete(@"c:\AnyDir\AnyFile.ext");

Exists

bool exist = ComToolkit.IO.File.Exists(@"c:\AnyDir\AnyFile.ext");

Move

ComToolkit.IO.File.Move(@"c:\AnyDir\AnyFile.ext", @"c:\AnyDir\Destination.ext");

Open

AdoFileStream stream = ComToolkit.IO.File.Open(@"c:\AnyDir\AnyFile.ext", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite);

OpenRead

AdoFileStream stream = ComToolkit.IO.File.OpenRead(@"c:\AnyDir\AnyFile.ext");

OpenRead

AdoFileStream stream = ComToolkit.IO.File.OpenWrite(@"c:\AnyDir\AnyFile.ext");

ReadAllBytes

byte[] bytes = ComToolkit.IO.File.ReadAllBytes(@"c:\AnyDir\AnyFile.ext");

ReadAllLines

string[] lines = ComToolkit.IO.File.ReadAllLines(@"c:\AnyDir\AnyFile.ext");

ReadAllLines

string[] lines = ComToolkit.IO.File.ReadAllLines(@"c:\AnyDir\AnyFile.ext");

ReadAllText

string text = ComToolkit.IO.File.ReadAllText(@"c:\AnyDir\AnyFile.ext");

WriteAllBytes

byte[] bytes = //some bytes...
ComToolkit.IO.File.WriteAllBytes(@"c:\AnyDir\AnyFile.ext", bytes);

WriteAllBytes

string[] contents = //some lines of text...
ComToolkit.IO.File.WriteAllLines(@"c:\AnyDir\AnyFile.ext", bytes);

WriteAllText

string contents = "my text";
ComToolkit.IO.File.WriteAllText(@"c:\AnyDir\AnyFile.ext", contents);

AppendAllLines

string[] lines = //some lines to append..
ComToolkit.IO.File.AppendAllLines(@"c:\AnyDir\AnyFile.ext", lines);

AppendAllText

string text = "my string to append";
ComToolkit.IO.File.AppendAllText(@"c:\AnyDir\AnyFile.ext", lines);

AppendText

string text = "my string to append";
StreamWriter sw = ComToolkit.IO.File.AppendText(@"c:\AnyDir\AnyFile.ext");

Last edited Jan 17, 2010 at 8:50 PM by mlarsson, version 1

Comments

No comments yet.