//internal static byte[] GetPictureBytes(string fileName) //{ // FileInfo fileInfo = new FileInfo(fileName); // byte[] buffer = new byte[fileInfo.Length]; // using (FileStream stream = fileInfo.OpenRead()) // { // stream.Read(buffer, 0, buffer.Length); // } // return buffer; //} internal static byte[] GetFileListBytes() { try { // LIST request - return list IEnumerable <string> files = PictureHelper.GetFileList(); StringBuilder responseMessage = new StringBuilder(); foreach (string s in files) { responseMessage.Append(s); responseMessage.Append(":"); } return(Encoding.ASCII.GetBytes( responseMessage.ToString())); } catch (DirectoryNotFoundException ex) { Console.WriteLine(ex.Message); throw; } }