And when you performed an
Type myType = myException.GetType();
PropertyInfo[] properties = myType.GetProperties();
what did you get?
--
Robbe Morris [Microsoft MVP - Visual C#]
AdvancedXL Server, Designer, and Data Analyzer
Convert cell ranges in Excel to rule driven web surveys
http://www.equalssolved.com/default.aspx
"JoeP" <No****@Hotmail.comwrote in message news:O8**************@TK2MSFTNGP03.phx.gbl...
Hi Robbin,
Thanks for your reply.
Here is the situation I have 2 objects such as: Execption or SMTPExecption
The SMTPExecption has the property StatusCode while the other does not.
I pass the the object into an error handle method where I log the properties into a text file.
Looking at the Watch window it seems that the Execption does not have System.Reflection etc...
Regards,
Joe
"Robbe Morris - [MVP] C#" <in**@eggheadcafe.comwrote in message news:eE**************@TK2MSFTNGP03.phx.gbl...
System.Reflection and iterate through the PropertyInfo[].
The Type of the object has a .GetProperties method.
--
Robbe Morris [Microsoft MVP - Visual C#]
.NET Setup Deployment - MSI, Cassini, SQL Server, NTFS
http://www.eggheadcafe.com/tutorials...oyment--m.aspx
"JoeP" <No****@Hotmail.comwrote in message
news:Of**************@TK2MSFTNGP03.phx.gbl...
>Hi All,
Need to check if the propery of an object exits.
oMyObject.Message
In some cases the Message property may not exists. I know the GetType()
can do it.
How would you check it?
Thanks,
Joe