If there a more efficient way to do the following:
DirectoryInfo di = new DirectoryInfo(@"c:\");
newFileName = Path.Combine(di.FullName, "MyFile.Txt");
I realise that it’s only two lines of code, but given that I already have the directory, it feels like I should be able to do something like:
newFileName = di.Combine(“MyFile.txt”);
EDIT:
Should have been more clear - I already have the path for another purpose, so:
DirectoryInfo di = MyFuncReturnsDir();
newFileName = Path.Combine(di.FullName, "MyFile.Txt");