NST
NST

Reputation: 51

After Converting VB To C# FileSystem.Dir

I have converted from VB to C# and unable to fix FileSystem.Dir.

tFile = FileSystem.Dir(Path.Combine(path, file));

Upvotes: 2

Views: 1569

Answers (1)

Kirk Woll
Kirk Woll

Reputation: 77576

While one usually doesn't use the assembly Microsoft.VisualBasic in C# code, there's nothing stopping you from doing so. Just add a reference and find it in the list of standard assemblies then make sure you have:

using Microsoft.VisualBasic;

While there might be more idiomatic C# solutions, using the original method is less likely to introduce a breaking change in porting the code.

Upvotes: 2

Related Questions