예제 #1
0
            public static ServerConnection GetGPConnection()
            {
                AppConfigFile    config     = new AppConfigFile();
                ServerConnection connection = new ServerConnection();

                connection.Server   = config.Item("GPSERVER");
                connection.Database = config.Item("GPDATABASE");
                connection.UserId   = config.Item("GPUSERNAME");
                connection.Password = config.Item("GPPASSWORD");
                int connectionTest = connection.Test();

                if (connectionTest == 0)
                {
                    return(connection);
                }
                else
                {
                    return(null);
                }
            }
예제 #2
0
            public static ServerConnection GetLogConnection()
            {
                AppConfigFile    config     = new AppConfigFile();
                ServerConnection connection = new ServerConnection();

                connection.Server   = config.Item("MODSERVER");
                connection.Database = config.Item("MODDATABASE");
                connection.UserId   = config.Item("MODUSERNAME");
                connection.Password = config.Item("MODPASSWORD");
                int connectionTest = connection.Test();

                if (connectionTest == 0)
                {
                    return(connection);
                }
                else
                {
                    logit($"ERROR: Connection Test Failed. Server={connection.Server}");
                    return(null);
                }
            }