Here is some code…
static bool RenameFile(FileInfo fi, string newFullFilename) { try { fi.MoveTo(newFullFilename); Console.WriteLine("New={0}", newFullFilename); } catch (Exception ex) { Console.WriteLine("Error {0} renaming {1}", ex.Message, newFullFilename); return false; } return true; } |
Here is a picture…
I notice that it does not do multi column or other more advanced formatting normally available in Word. Maybe I will give this a shot since it does give you the robust spelling/grammar checking of Word.
PS. I had to go into this post from the WordPress editor and clean up the code section. The different way of single spacing something using <p> vs <br> is the issue. Every line of code is a <p> when in fact I want it to end with <br>. Oh well. Not as good as I hoped.
I took the code above and plugged it into the code formatter I previously blogged about here. It looks like the following, which in preview mode looks pretty good.
static bool RenameFile(FileInfo fi, string newFullFilename)
{
try
{
fi.MoveTo(newFullFilename);
Console.WriteLine(“New={0}”, newFullFilename);
}
catch (Exception ex)
{
Console.WriteLine(“Error {0} renaming {1}”, ex.Message, newFullFilename);
return false;
}
return true;
}
No comments:
Post a Comment