
Get the Size of a File in FTP with C#
Using the System.Net.WebRequestMethods.FTP class, we can use the “SIZE” FTP Protocol method to get the size of the file in FTP. Below is an example in C#: var request =

Using the System.Net.WebRequestMethods.FTP class, we can use the “SIZE” FTP Protocol method to get the size of the file in FTP. Below is an example in C#: var request =

In order to floodfill drawn objects, you can make use of the following sample: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace FloodFill{ public partial class Form1 : Form

We can use an alias for long namespaces and use it further down in the code. For an example, see below: //InteropExcel is the aliasusing InteropExcel = Microsoft.Office.Interop.Excel;public class SpreadSheetInteropHelper{

Use the following code to block and unblock Internet connectivity on a user’s PC: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Diagnostics;using System.IO;using System.Reflection;namespace BlockInternet{ public partial class

Use the GetLeftPart method on the HttpRequest’s URI with Authority as the UriPartial’s value to retrieve the DNS Name. string dnsName = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); Related Articles Using Aliases for Namespaces in

ASP.NET websites need some static data to be initialized, so that subsequent requests can utilize the loaded data and load much faster. It is a common practice to write such

During testing or monitoring, there is a constant need to monitor the number of sessions created, so as to better correlate the performance metrics collected. The Performance Monitor tool is

The ErrorProvider control is quite useful when it comes to user input validation. The next code segment assumes an ErrorProvider control named errorProvider1 has been placed on a form along

SendKeys is very powerful. You can use SendKeys to send a different keycode from the one that was pressed. For example: private void TextBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode