Hi, I have a class containing:
[Serializable]
public class ClsStatus
{
public byte[] Image { get; set; }
public string Status { get; set; }
public List<string> Servers { get; set; }
}
Now i am doing:
System.Drawing.Image image = null;
byte[] imageBytes = null;
// Create an image of the chart.
using (MemoryStream s = new MemoryStream())
{
chart.ExportToImage(s, System.Drawing.Imaging.ImageFormat.Jpeg);
image = System.Drawing.Image.FromStream(s);
imageBytes = s.ToArray();
}
ClsStatus status = new ClsStatus();
List<string> servers = new List<string>();
servers.Add("Server1");
servers.Add("Server2");
servers.Add("Server2");
status.Image = imageBytes;
status.Status = "Up & Running";
status.Servers = servers;
//XML Serialization
XmlDocument doc = new XmlDocument();
XmlSerializer serializer = new XmlSerializer(status.GetType());
MemoryStream stream = new MemoryStream();
try
{
serializer.Serialize(stream, status);
stream.Position = 0;
doc.Load(stream);
Response.ContentType = "text/xml";
Response.Clear();
Response.Write(doc.InnerXml);
}
catch
{
throw;
}
My Desired out put and what i am getting fro the above code is here: http://i.imgur.com/YgKgH.jpg
Is there any one who can help me in solving my issue?
Regards, Mohin