Message Format using C#
<p>I was trying to convert a sample win form app to console application.I just stuck when am trying to convert to message format.</p>

<p>Here is the below original code from winform</p>

<pre><code>private void PutMessage(StringBuilder message, string mediaType, string filename)
{

    message.AppendFormat(messageFormat, "FileSize", videoInterrogator.GetFileSize(), Environment.NewLine);
    message.AppendFormat(messageFormat, "Duration", videoInterrogator.GetDuration(), Environment.NewLine);

}
</code></pre>

<p>Am trying to do the same in my console application </p>

<p>Am calling the method from FTPDownload method so the code look like</p>

<pre><code>PutMessage(file, message);


private void PutMessage(string filename, StringBuilder message)
{
    VideoInterrogator videoInterrogator = new VideoInterrogator();
    videoInterrogator.LoadFile(filename);
    message.AppendFormat(format, "FileSize", videoInterrogator.GetFileSize(), Environment.NewLine);
    message.AppendFormat(format, "Duration", videoInterrogator.GetDuration(), Environment.NewLine);

}
</code></pre>

<p>Any help please how can i call this method pass the file name and return the values.It throws exception at "Format" am not sure what am missing here.</p>
