Related questions
Calculate the execution time of a method
Possible Duplicate:
How do I measure how long a function is running?
I have an I/O time-taking method which copies data from a location to another. What's the best and most real way of calculating the execution time? Thread? …
How to Find And Replace Text In A File With C#
My code so far
StreamReader reading = File.OpenText("test.txt");
string str;
while ((str = reading.ReadLine())!=null)
{
if (str.Contains("some text"))
{
StreamWriter write = new StreamWriter("test.txt");
}
}
I know how to find the text, but I have no idea …
Cannot delete directory with Directory.Delete(path, true)
I'm using .NET 3.5, trying to recursively delete a directory using:
Directory.Delete(myPath, true);
My understanding is that this should throw if files are in use or there is a permissions problem, but otherwise it should delete the directory and …