I want to read the content in a file which is residing in SFTP using c#. I'm able to fetch the file from the SFTP and download it. I want to read the data in the file without downloading. Could anyone help me on this?
foreach (var fi in listDirectory)
{
Console.WriteLine(fi.Name);
if (fi.Name.Contains(".xml") )
{
string remoteFileName = fi.Name;
using (Stream file1 = File.OpenRead(target + remoteFileName))
{
Console.WriteLine(file1);
}
Thanks.