I have made a vb project that works with registry and system management but my code is like this:
CheckAnswer(question_id)
it means that each question has own works with sys registry and sys management and I wanted that the program read each question from file at runtime.
my CheckAnswer
body function that I made is :
Private Sub CheckAnswer(ByVal id As Integer)
Dim mark As Integer
mark = 0
''''''''''''''''''''''
Select Case id
Case 1
Dim r As Rectangle = Nothing
If GetTaskBarPosition(r, Me.Handle) Then
If r.Y = 0 And r.X = 0 Then mark = 1
End If
Case 2
If My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\", "TaskbarSizeMove", 1) = 0 Then mark = 1
end case
but I wanted to do this work at runtime and say to program that read function from a file not from the source code for flexibility and adding new questions without changing the program source and just with changing the function file.
I have searched this site and others for code generation and the other things like this and code provider. I have get a project from "code project" but give me compile errors.
I do not want to generate separate class code because I have implemented imports and libraries in my own class and I want to say the program just which one of them I want to use in my function file.