Skip to main content

Posts

Showing posts from October, 2016

Add or Remove TextBoxes Dynamically Using jQuery.

<html> <head>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> </head> <body> <button id="Add">Click to add textbox</button> <button id="Remove">Click to remove textbox</button>     <div id="textboxDiv"></div>     <script>         $(document).ready(function() {             $("#Add").on("click", function() {                 $("#textboxDiv").append("<div><br><input type='text'/><br></div>");             });             $("#Remove").on("click", function() {                 $("#textboxDiv").children().last().remove();             });         });     </script> </body> </html>  

Download File from the FTP Server in C#.

string _ftpURL = "testftp.com";             //Host URL or address of the FTP server string _UserName = "username";                 //User Name of the FTP server string _Password = "Password";              //Password of the FTP server string _ftpDirectory = "FTP Foldername";          //The directory in FTP server where the files are present string _FileName = "niks.csv";             //File name, which one will be downloaded string _LocalDirectory = "D:\\";  //Local directory where the files will be downloaded DownloadFile(_ftpURL, _UserName, _Password, _ftpDirectory, _FileName, _LocalDirectory); public void DownloadFile(string ftpURL, string UserName, string Password, string ftpDirectory, string FileName, string LocalDirectory) {     if (!File.Exists(LocalDirectory + "/" + FileName))     {         try         {             FtpWebRequest requestFileDownload = (FtpWebRequest)WebRequest.Create(ftpURL + "/"