Hi,
I am using the WMI management object to obtain values about the network
cards installed on the system.
The MSDN tells me the following
class Win32_NetworkAdapterConfiguration : CIM_Setting
{
...
datetime DHCPLeaseExpires;
datetime DHCPLeaseObtained;
...
};
When I use the following code
Dim dExpires as DateTime
dExpires = CType(wmi.Item("DHCPLeaseExpires"), DateTime)
I Get the following exception
System.InvalidCastException: Cast from string
"20041109122048.000000+120" to type 'Date' is not valid.
at Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String
Value, CultureInfo culture)
at Microsoft.VisualBasic.CompilerServices.DateType.Fr omString(String
Value)
at Microsoft.VisualBasic.CompilerServices.DateType.Fr omObject(Object
Value)
at Assimilator.SDK.clsNICProperties.PopulateNetworkAd apterArray() in
V:\VBNET\Assimilator Ver 4.2\Assimilator.SDK\clsNICProperties.vb:line
212
How do I fix ?????
:)
Thank You
Mark Hollander
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!