Read Multiple Files from folder and Download using FTP location in Console Application using C#

Read Multiple Files from folder and Download using FTP location in Console Application using C#

Today I’m going to tell you to read multiple files from folder using FTP Location.Please follow below steps to fetch Step 1 :- Place code in Class file string ftpDownloadResult = string.Empty; try { WebRequest request = WebRequest.Create(ConfigurationManager.AppSettings["FTPPath"]); request.Method = WebRequestMethods.Ftp.ListDirectory; request.Credentials = newNetworkCredential(ConfigurationManager.AppSettings["FTPUserName"], ConfigurationManager.AppSettings["FTPPassword"]);
Read File from FTP location in Console Application using C#

Read File from FTP location in Console Application using C#

Today I'm going to tell you to read text from FTP Location.Plz follow below steps to fetch Step 1 :- Place code in Class file WebRequest request = WebRequest.Create(ConfigurationManager.AppSettings["FTPPath"]); request.Method = WebRequestMethods.Ftp.DownloadFile; request.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["FTPUserName"], ConfigurationManager.AppSettings["FTPPassword"]);
Import Data from Excel and CSV to SQL server using C# in Asp.net

Import Data from Excel and CSV to SQL server using C# in Asp.net

The Page having a FileUpload control and the Upload button, on selecting the Excel or CSV file user needs to click on Upload button to store the data to Server. Here we are treating the uploaded file as database hence we need to create OLEDB connection to this file, from this connection will be created and the data is fetched to C# as DataTable. '[Sheet1$]' is the Name of the Worksheet where requires data is present. Table CREATE TABLE [dbo].[Tag]( [ID] [int] IDENTITY(1,1) NOT NULL, [TagType] [int] NULL, [TagCode] [nvarchar](100) NULL, [Status] [bit] NULL, [Duration] [int] NULL) Stored Procedure Create proc [dbo].[ExcelTag] @TagType int, @TagCode nvarchar(100), @Status bit, @Duration int as if Not exists(Select top 1 TagCode from dbo.[Tag] where TagCode=@TagCode) Begin insert into dbo.[Tag](TagType,TagCode,[Status],Duration)values(@TagType,@TagCode,@Status,@Duration) End
Difference between Authorization and Authentication

Difference between Authorization and Authentication

Authentication Authorization Authentication verifies who you are Authorization verifies what you are authorized to do Authenticating a user on a website means that you verify that this user is a valid user, that is, verifying who the user is using username/password or certificates, etc Authorization is the process of verifying if the user has rights/permission to access certain resources or sections of a website, Example : When u login to access some site then your logon credential (userid/password) identifies Example : After successful logon, you will be granted specific role or privileges to access the site.
Difference between Destructor, dispose and finalize method

Difference between Destructor, dispose and finalize method

Destructor They are special methods that contains clean up code for the object. You can’t call them explicitly in your code as they are called implicitly by GC (Garbage Collector). In C# they have same name as the class name preceded by the "~" sign. Like- class MyClass { public MyClass () { } ~MyClass () { } } Dispose These are just like any other methods in the class and can be called explicitly but they have a special purpose of cleaning up the object. In the dispose method we write clean up code for the object. It is important that we freed up all the unmanaged resources in the dispose method like database connection, files etc. The class implementing dispose method should implement IDisposable which is inherited by interface and it contains GC.SuppressFinalize method for the object it is disposing if the class has destructor because it has already done the work to clean up the object, then it is not necessary for the garbage collector to call the object's Finalize method.