How to pass optional parameters to a method in C#?
<p>How to pass optional parameters to a method in C# ?</p>

<p>Suppose i created one method called Sendcommand</p>

<pre><code>public void SendCommand(String command,string strfilename)
{

    if (command == "NLST *" ) //Listing Files from Server.
    {
        //code
    }
    else if (command == "STOR " + 
        Path.GetFileName(uploadfilename)) //Uploading file to Server
    {
        //code
    }
    else if ............

}
</code></pre>

<p>Now i want to call this method in main method like</p>

<pre><code>Sendcommand("STOR ", filename);
Sendcommand("LIST"); // In this case i dont want to pass the second parameter
</code></pre>

<p>How to achieve that ?
Any Code snippet is highly appreciated.</p>
