コード例 #1
0
ファイル: global.cs プロジェクト: hnjm/AmbleSystem
 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://" + strServer + ":1111/DatabaseInfo");
         userId   = DesOp.DecryptDES(dbinfo.GetDbUser());
         password = DesOp.DecryptDES(dbinfo.GetDbPassword());
     }
     catch (Exception ex)
     {
         Logger.Error(ex.Message);
         Logger.Error(ex.StackTrace);
         //    MessageBox.Show("Can not Connected to the Server---------, Please contact the Admin.");
     }
 }
コード例 #2
0
 public static void SetPassword(string password)
 {
     OperatorFile.WriteIniFileString("Login", "Pwd",DesOp.EncryptDES(password), file);
 }
コード例 #3
0
 public static string GetPassword()
 {
     return DesOp.DecryptDES(OperatorFile.GetIniFileString("Login", "Pwd", "", file));
 }