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 8318701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:04:04+00:00 2026-06-08T22:04:04+00:00

in my project i have xml file to store and retrieve Device Objects and

  • 0

in my project i have xml file to store and retrieveDevice Objects
and i want user can add or delete in my xml file only by my application not manually
so i need to story data in some format user cannot understand it like viewState in asp.net base64 or some thing else

My Question is how i can save my data in xml file but i want user can not understand what is written

this is my Device Class

public class Device
    {
        public string Username { get; set; }
        public string AgentName { get; set; }
        public string Password { get; set; }
        public string Domain { get; set; }
        public string PeerURI { get; set; }
        public string SipURI { get; set; }
        public string FQDN { get; set; }
        public Enums.DeviceType Type { get; set; }
        public Enums.ServerTransportType TransportType { get; set; }
        public bool IsInitialized { get; set; }
    }

and this is my xml file

<?xml version="1.0" encoding="utf-8"?>
<settings>
  <username>foo</username>
  <AgentName>foo1</AgentName>
  <password>foo2</password>
  <domain>go</domain>
  <peerUri>140.242.250.200</peerUri>
  <sipUri>sip:xxx@xxxxx.com</sipUri>
  <fqdn>ff.go.xxxx.com</fqdn>
  <type>2</type>
  <transportType>2</transportType>
</settings>
  • 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-06-08T22:04:08+00:00Added an answer on June 8, 2026 at 10:04 pm

    If you use Binary Serialisation, the file is not human readable at all.

    Here is a short example for your issue:

    public class Enums
    {
        public enum DeviceType
        {
            Mouse,
            HardDisk,
            CdRom,
        }
    
        public enum ServerTransportType
        {
            Udp,
            Tcp,
        }
    }
    
    [Serializable]
    public class Device
    {
        public string Username { get; set; }
        public string AgentName { get; set; }
        public string Password { get; set; }
        public string Domain { get; set; }
        public string PeerURI { get; set; }
        public string SipURI { get; set; }
        public string FQDN { get; set; }
        public Enums.DeviceType Type { get; set; }
        public Enums.ServerTransportType TransportType { get; set; }
        public bool IsInitialized { get; set; }
    }
    
    public class BinarySerialize
    {
        public void Test()
        {
            var device = new Device();
    
            device.Username = "userName";
            device.AgentName = "agentName";
            device.Password = "password";
            device.Domain = "domain";
            device.PeerURI = "peerURI";
            device.SipURI = "sipURI";
            device.FQDN = "fqdn";
            device.Type = Enums.DeviceType.HardDisk;
            device.TransportType = Enums.ServerTransportType.Tcp;
            device.IsInitialized = true;
    
            string fileName = @"C:\temp\device.bin";
            this.Serialize(device, fileName);
    
            var d = this.Deserialize(fileName);
        }
    
        public void Serialize(Device device, string fileName)
        {
            using (Stream stream = File.Open(fileName, FileMode.Create))
            {
                BinaryFormatter bformatter = new BinaryFormatter();
                bformatter.Serialize(stream, device);
                stream.Close();
            }
        }
    
        public Device Deserialize(string fileName)
        {
            var device = new Device();
    
            using (Stream stream = File.Open(fileName, FileMode.Open))
            {
                BinaryFormatter bformatter = new BinaryFormatter();
                device = (Device)bformatter.Deserialize(stream);
                stream.Close();
            }
    
            return device;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my project.gwt.xml file I have <script src=http://maps.google.com/maps?gwt=1&amp;file=api&amp;v=2&amp;sensor=false;key=MYKEY /> But, when I load my
When I have an Eclipse update site project, a site.xml file is created which
I have the following defined in a file called build-dependencies.xml <?xml version=1.0 encoding=UTF-8?> <project
I want to connect my log4j.xml with log4j.xsd (xml schema). Project don't have any
The project I have been given is to store and retrieve unstructured data from
I have 200,000 XML files I want to parse and store in a database.
I have an Xcode project which basically loads and parses a xml file which
I'm working on a windows phone project where I have some xml files with
I have an XML class inside a .NET 3.5 project which is the top
I have a project that contains xml files. I also have an Ant build

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.