Difference between revisions of "ProcessShellRequest"
From RayHarwood
Rayharwood (Talk | contribs) (Created page with "When doing a command line argument setup, here is code for processing the request: Private Function ProcessShellRequest(ByVal TheArgs() As String, ByVal TheSource As Stri...") |
Rayharwood (Talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | When doing a | + | When doing a [[Batch Mode and Command-Line Arguments]] setup, here is code for processing the request. Each case selector calls the routine that actually does the work. I typically build the work-code from an interactive GUI form with buttons, then strip the work-code from the button handler, place into a sub, call the sub from the button handler '''and''' from the ProcessShellRequest below. That way, I can run the code in a batch file, but also still run it from the GUI if I need to do some "manual processing." |
Private Function ProcessShellRequest(ByVal TheArgs() As String, ByVal TheSource As String) As ShellResult | Private Function ProcessShellRequest(ByVal TheArgs() As String, ByVal TheSource As String) As ShellResult | ||
| Line 27: | Line 27: | ||
Console.WriteLine("Shell request = " & ShellRequest) | Console.WriteLine("Shell request = " & ShellRequest) | ||
Select Case ShellRequest | Select Case ShellRequest | ||
| + | ' Some items removed from examples... | ||
Case "db", "database" | Case "db", "database" | ||
LogDBinfo() | LogDBinfo() | ||
| Line 33: | Line 34: | ||
My.Settings.ITSec_ConnString_RunTime = My.Settings.ITSec_Test_ConnString | My.Settings.ITSec_ConnString_RunTime = My.Settings.ITSec_Test_ConnString | ||
LogDBinfo() | LogDBinfo() | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Case "send_email_notices" | Case "send_email_notices" | ||
Dim SEN As New EmailNotices | Dim SEN As New EmailNotices | ||
SEN.Send_Email_Notices(LogFile) | SEN.Send_Email_Notices(LogFile) | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Case "get_active_imports", "run_active_imports" | Case "get_active_imports", "run_active_imports" | ||
Process_Run_Active_Imports(ArgArray) | Process_Run_Active_Imports(ArgArray) | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Case "get_ad_account_info" | Case "get_ad_account_info" | ||
Process_Get_AD_Account_Info(ArgArray) | Process_Get_AD_Account_Info(ArgArray) | ||