473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Compare Serialized object

Hello There.

I hava a Myclass [] obj1 in wich I add my computer hardware configuration.
After this object is "filled", I serialize it, into a dat file.

Then I deserialize it into obj2 and I compare the original and the
deserialized object, and they do not match! They sould match, I think. I use
obj1.Equals(obj2).

The goal is to find hardware changes when the computer starts.

Any help would be apreciated.

Paez
Dec 30 '06 #1
1 2586

Paez wrote:
Hello There.

I hava a Myclass [] obj1 in wich I add my computer hardware configuration.
After this object is "filled", I serialize it, into a dat file.

Then I deserialize it into obj2 and I compare the original and the
deserialized object, and they do not match! They sould match, I think. I use
obj1.Equals(obj2).

The goal is to find hardware changes when the computer starts.

Any help would be apreciated.

Paez
No, they won't match unless you overload the Equals method. The
default Equals method compares the object references. Deserializing an
object creates a new instance of the object, so the references no
longer compare as equal.

--
Tom Shelton

Dec 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Russ | last post by:
Hi, What's the easiest way of modifying an object which has been serialized to a DB? The previous developer created a complex object hierarchy and binary serialized the whole thing to a single...
0
by: Ray Mitchell | last post by:
Hello, The result of auto-converting some Java code to C# yielded the following upgrade issue regarding the original Java call to "reset()": public virtual void writeObj(Object obj) {...
0
by: Wim Hollebrandse | last post by:
Here's the scenario. I'm serializing a particular object, which contains other objects as properties. I have this particular enum type that won't get included in the serialized XML. For...
0
by: Pierre | last post by:
Hi, I'm trying to select specific nodes from a XmlDocument filled with a serialized object and to insert these nodes into another XmlDocument. The object is well serialized (see below). From a...
2
by: Dennis C. Drumm | last post by:
Is there a way to open files with .net 1.1 versions of my software product that were serialized with a .net 2.0 version of same product? Right now, as soon as my older .net 1.1 application tries to...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
3
by: MMiGG | last post by:
Hi Our project need parse JAVA serialized object string in C, has any library? Thanx
1
by: Phil Galey | last post by:
I'm using XMLSerializer in VB.NET to serialize class-based objects to XML. It's serializing fine, except that I don't seem to have control over the order in which the various fields (properties) of...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.