static ServerInfo() { try { strServer = OperatorFile.GetIniFileString("DataBase", "Server", "", Environment.CurrentDirectory + "\\AmbleAppServer.ini"); } catch (Exception ex) { Logger.Error(ex.Message); MessageBox.Show("Please check the AmbleAppServer.ini file."); } try { ChannelServices.RegisterChannel(new TcpClientChannel(), false); dbinfo = (DatabaseInfo)Activator.GetObject(typeof(DatabaseInfo), "tcp://192.168.1.101:1111/DatabaseInfo"); userId = DecryptDES(dbinfo.GetDbUser(), desKey); password = DecryptDES(dbinfo.GetDbPassword(), desKey); } catch (Exception ex) { Logger.Error(ex.Message); Logger.Error(ex.StackTrace); // MessageBox.Show("Can not Connected to the Server---------, Please contact the Admin."); } }