Re: Setting time in .net 2.0

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm using the RC released on 9/12/05.

I have looked through MSDN and searched through Google and cannot find a
reference to the ResetTimeZone() method. Do you know where there is
documentation on this?

Here is what I'm trying. Does this code look correct? I haven't done
much with reflection so I want to make sure that it's not just something
that I'm doing wrong with my syntax.

Dim mi As MethodInfo = tz.GetType().GetMethod("ResetTimeZone")
Dim obj As Object = Activator.CreateInstance(tz.GetType())
Dim param As Object() = New Object()
mi.Invoke(obj, param)

And when I run it, there is an exception on the second line that says:

System.MissingMethodException was unhandled
Message="MissingMethodException"
StackTrace:
at System.Activator.CreateInstance()
at UpdateTime.frmUpdateTime.Button1_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at UpdateTime.Form1.Main()

Thanks,
david


--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
.


Quantcast