Display file from FTP Server
public static void DownloadFromFTP(string sourceFile, string destinationFile,RichTextBox rtxtJResume)
{
if (IsFTPConnected())
{
string partnet_Dir = string.Empty;
partnet_Dir = ClsConfigurations.ReadSetting("Folder");
string[] id = sourceFile.Split('-');
objFTPCon.ServerDirectory = @"/" + partnet_Dir + "/" + id[0];
objFTPCon.DownloadFile(destinationFile, sourceFile);
FileInfo fi = new FileInfo(destinationFile);
string file = System.Windows.Forms.Application.StartupPath + "\\temp" + fi.Extension.ToLower();
string text = ClsFile.ExtractTextFromFile(file);
File.Delete(System.Windows.Forms.Application.StartupPath + "\\temp" + fi.Extension.ToLower());
rtxtJResume.Text = text;
}
}
{
if (IsFTPConnected())
{
string partnet_Dir = string.Empty;
partnet_Dir = ClsConfigurations.ReadSetting("Folder");
string[] id = sourceFile.Split('-');
objFTPCon.ServerDirectory = @"/" + partnet_Dir + "/" + id[0];
objFTPCon.DownloadFile(destinationFile, sourceFile);
FileInfo fi = new FileInfo(destinationFile);
string file = System.Windows.Forms.Application.StartupPath + "\\temp" + fi.Extension.ToLower();
string text = ClsFile.ExtractTextFromFile(file);
File.Delete(System.Windows.Forms.Application.StartupPath + "\\temp" + fi.Extension.ToLower());
rtxtJResume.Text = text;
}
}