public void StartUC() { string applicationUserAgent = ConfigurationManager.AppSettings["applicationuseragent"]; string applicationUrn = ConfigurationManager.AppSettings["applicationurn"]; ucBotHost = new UCBotHost(applicationUserAgent, applicationUrn); ucBotHost.Run(); }
static void Main(string[] args) { try { Logger.Debug("main bot function"); Debug.Listeners.Add(new ConsoleTraceListener()); String applicationUserAgent = ConfigurationManager.AppSettings["applicationuseragent"]; String applicationurn = ConfigurationManager.AppSettings["applicationurn"]; Logger.Debug("applicationUserAgent : " + applicationUserAgent); Logger.Debug("applicationurn : " + applicationurn); UCBotHost ucBotHost = new UCBotHost(applicationUserAgent, applicationurn); Logger.Debug("ucBotHost init: " + ucBotHost.ToString()); Logger.Debug("ucBot is running..."); ucBotHost.Run(); } catch (Exception e) { Logger.Debug("error : " + e); Console.ReadLine(); } }
/// <summary> /// Initializes the excel bot. /// </summary> public static void Initialize() { Debug.Listeners.Add(new ConsoleTraceListener()); string currentDirectory = Path.GetDirectoryName(Path.GetFullPath(Assembly.GetExecutingAssembly().Location)); string inputPath = Path.Combine(currentDirectory, "BotConfig.xlsx"); InitializationHelper.BotConfigFilePath = Path.Combine(currentDirectory, "BotConfig.xml"); BotInfo botInfo = InteropHelper.LoadExcelSpreadsheet(inputPath, InitializationHelper.BotConfigFilePath); Logger.Log("Spreadhseet loaded, xml generated at " + InitializationHelper.BotConfigFilePath); UCBotHost ucBotHost = new UCBotHost(botInfo.ApplicationUserAgent, botInfo.ApplicationUserAgent, "Sorry, I was not able to understand you.".EncloseRtf()); ucBotHost.Run(); ucBotHost.ErrorOccurred += new BuildABot.Core.ErrorEventHandler(ucBotHost_ErrorOccurred); Logger.Log("UCBotHost created, now initializing..."); ucBotHost.Run(); }