By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,162 Members | 1,346 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,162 IT Pros & Developers. It's quick & easy.

Xml Deserialization of string value

P: n/a
I am deserializing an xml file to an object and wanted to know how
strings are converted to their proper types.

For example consider this fragment of xml:

<FileLoader MaxFileSize="30000" />

I have a class called FileLoader with a property called MaxFileSize
defined as a Long. When the xml is deserialized, how is the string
value in the xml file converted to a Long? Does it use CLng? Does it
use Convert.ToInt64?

I want to be able to control the conversion to some extent in that if
the xml contained something like this:

<FileLoader MaxFileSize="30M" />

That the value would be deserialized to a Long with a value of 30000000

Or if I specify

<FileLoader MaxFileSize="30K" />

That the value would be deserialized to a Long with a value of 30000

In other words, the xml may not just contain a number. It might be a
number with an M or K on it to indicate the units.

Can the deserialization be controlled in this manner?

Thanks

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.