I was trying to convert a sample win form app to console application.I just stuck when am trying to convert to message format.
Here is the below original code from winform
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);
}
Am trying to do the same in my console application
Am calling the method from FTPDownload method so the code look like
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);
}
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.
formatdeclared, for example?