Re: WBEM time in VB.NET WQL SelectQuery
From: Dmitry (Dmitry_at_discussions.microsoft.com)
Date: 07/14/04
- Previous message: Thomas Jansen: "win32_DiskDrive and win32_IDEControllerDevice"
- In reply to: Torgeir Bakken \(MVP\): "Re: WBEM time in VB.NET WQL SelectQuery"
- Next in thread: Viatcheslav V. Vassiliev: "Re: WBEM time in VB.NET WQL SelectQuery"
- Reply: Viatcheslav V. Vassiliev: "Re: WBEM time in VB.NET WQL SelectQuery"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 09:23:02 -0700
Well, I do string manipulations now, but it is very strange, that this functionality is present in VBScript, and it's absent in .NET...
I still would like to figure out now to convert this type within .NET native functionality and not converting date to string and re-compiling it for WQL. I tried to contact out MS account, and all they could recommend is to call Premier support ($1K call) which my management is not approving at the moment. I am reluctant to believe that I am the only one who needs to query event log from VB.NET with WMI/WQL here.
I know that .NET having its own event log readers, but I can't compile query complex enough to target exact events in exact time. WMI seems to be "the tool" for this situation... anybody from Microsoft monitoring this post? Please comment.
"Torgeir Bakken (MVP)" wrote:
> Dmitry wrote:
>
> > Anybody? I know that somebody should know it!
> > I am looking for VB.NET way of doing following:
> >
> > [VB Script]
> > CONST CONVERT_TO_LOCAL_TIME = TRUE
> > SET dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
> > TIME_START = "12/12/2004"
> > dtmStartDate.SetVarDate TIME_START, CONVERT_TO_LOCAL_TIME
> > [EOF]
> >
> > Anybody? Please! I am reading event log with WQL and need to query
> > certain events between 2 dates.
> > It seems like WQL requiring following format for the date:
> > Example: 20040629010540.000000-300
> >
> > How do I convert "06/29/2004 10:54 AM" to "20040629010540.000000-300"
> > ????
> Hi
>
> I would think VB.NET has some date functions as well as string
> manipulation functions, so you can build the string yourself,
> like the VBScript example in this post:
>
> http://groups.google.com/groups?threadm=3E8245FB.819F13D4%40hydro.com
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/community/scriptcenter/default.mspx
>
- Previous message: Thomas Jansen: "win32_DiskDrive and win32_IDEControllerDevice"
- In reply to: Torgeir Bakken \(MVP\): "Re: WBEM time in VB.NET WQL SelectQuery"
- Next in thread: Viatcheslav V. Vassiliev: "Re: WBEM time in VB.NET WQL SelectQuery"
- Reply: Viatcheslav V. Vassiliev: "Re: WBEM time in VB.NET WQL SelectQuery"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|