Posts From The Archive

C# File Rename

I don't have a direct need for this little class anymore, but I hate to delete it. Seems like something that would come in handy at some point in the future. [Read More]

C# UNC Path

For some odd reason, System.IO doesn’t include a method to get the UNC path for a file or directory. Even stranger, many code samples resort to using p/invoke in order to get that information. But then I came across this StackOverflow answer that explained a pure .NET way to do the same thing. I gave the original code a good refactoring and turned it into the extension method below. While the most obvious place to stick something like this is the Path class, since it’s static that’s not possible. [Read More]