Akula
asked on
Simple parsing question
Hi all,
I have a simple yet confusing (for me) question.
I have created a scheduling type of scenario.
I want some code to fire at a certain time on certain days.
Now, here is my dilema:
I have set some values in the registry and I later read from there to determine the day of week.
But, I have this in the registry 1,3,5 for Mon,Wed,Fri.
I then read these values to see if I need to fire the code off.
My code to check:
Dim WDay As String
If Microsoft.Win32.Registry.L ocalMachin e.OpenSubK ey("Softwa re\.....\V alue", True).GetValue("Daylog") = 0 Then
WDay = "Sunday"
End If
If Microsoft.Win32.Registry.L ocalMachin e.OpenSubK ey("Softwa re\.....\V alue", True).GetValue("Daylog") = 1 Then
WDay = "Monday"
End If
If Microsoft.Win32.Registry.L ocalMachin e.OpenSubK ey("Softwa re\.....\V alue", True).GetValue("Daylog") = 2 Then
WDay = "Tuesday"
End If
If Microsoft.Win32.Registry.L ocalMachin e.OpenSubK ey("Softwa re\.....\V alue", True).GetValue("Daylog") = 2 Then
WDay = "Tuesday"
End If
If WDay = Date.Now.DayOfWeek.ToStrin g Then
my code here
End If
But when it checks and there is more than one number, then nothing happens.
I gues I need to parse the values in some way; or maybe a better way to do this?
Help !!
Ak
I have a simple yet confusing (for me) question.
I have created a scheduling type of scenario.
I want some code to fire at a certain time on certain days.
Now, here is my dilema:
I have set some values in the registry and I later read from there to determine the day of week.
But, I have this in the registry 1,3,5 for Mon,Wed,Fri.
I then read these values to see if I need to fire the code off.
My code to check:
Dim WDay As String
If Microsoft.Win32.Registry.L
WDay = "Sunday"
End If
If Microsoft.Win32.Registry.L
WDay = "Monday"
End If
If Microsoft.Win32.Registry.L
WDay = "Tuesday"
End If
If Microsoft.Win32.Registry.L
WDay = "Tuesday"
End If
If WDay = Date.Now.DayOfWeek.ToStrin
my code here
End If
But when it checks and there is more than one number, then nothing happens.
I gues I need to parse the values in some way; or maybe a better way to do this?
Help !!
Ak
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excallibur,
Your code was extremely helpful as well.
I will post a question worth 100 points for you as well.
Ak