using System.IO; FileInfo fileInfo = new FileInfo("C:/docs/myfile.txt"); Console.WriteLine(fileInfo.ToString());This code creates a new instance of the FileInfo class for the file "C:/docs/myfile.txt", and then calls the ToString method to retrieve a string representation of the file's path, name, and extension. The output of this code would be "C:\docs\myfile.txt". The ToString method of the FileInfo class is a part of the System.IO package library.