Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1096383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:16:37+00:00 2026-05-17T00:16:37+00:00

I have a class containing: [Serializable] public class ClsStatus { public byte[] Image {

  • 0

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:
https://i.stack.imgur.com/YgKgH.jpg

Is there any one who can help me in solving my issue?

Regards,
Mohin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:16:38+00:00Added an answer on May 17, 2026 at 12:16 am

    XML is pretty much a text-based format, which means you’re not going to be able to “see the image” in your XML document.

    The closest you can get is to encode the binary image data into a “text” string (typically through Base64 encoding) and then embed the string into the XML document. That’s exactly what you’re getting now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 539k
  • Answers 539k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you override eql?, you also always need to override… May 17, 2026 at 2:21 am
  • Editorial Team
    Editorial Team added an answer What exactly do you think that regex matches? Try Pattern… May 17, 2026 at 2:21 am
  • Editorial Team
    Editorial Team added an answer Just in case anyone is interested and/or having the same… May 17, 2026 at 2:21 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a Python class containing a list, to which I append() values. If
I have a 2 entities in a One-To-Many relationship: OfficeView.java: public class OfficeView implements
When I have a class containing static stuff, how can I free the memory
I have a table containing data and one of the fields is 'class' When
Consider the following. You have a class that you want to serialize with XmlSerializer
Let's say I'm writing a DayData class, containing the ivars NSString *symbol; //such as
I have a class where each instance is basically of a bunch of nested
I have an elementary stumper using serialization in an ASP.NET 2.0 application on a
I have a very specific deserialization need, see example below: say I have following
I have two classes SccmAction and TicketAction which both implement interface IDelivery. These classes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.