Пример #1
0
 public static void Main(string[] args)
 {
     if (args.Length == 3)
     {
         try {
             string userName, password;
             using (StreamReader r = new StreamReader("password.txt")) {
                 userName = r.ReadLine();
                 password = r.ReadLine();
             }
             TranslationServer server = new TranslationServer(new TextBox());
             if (!server.Login(userName, password))
             {
                 MessageBox.Show("Login failed");
                 return;
             }
             server.AddResourceString(args[0], args[1], args[2]);
             MessageBox.Show("Resource string added to database on server");
             return;
         } catch (Exception ex) {
             MessageBox.Show(ex.ToString());
         }
     }
     Application.EnableVisualStyles();
     Application.Run(new MainForm());
 }
Пример #2
0
 void Button3Click(object sender, EventArgs e)
 {
     server = new TranslationServer(outputTextBox);
     if (savePasswordCheckBox.Checked)
     {
         using (StreamWriter w = new StreamWriter("password.txt")) {
             w.WriteLine(userNameTextBox.Text);
             w.WriteLine(passwordTextBox.Text);
         }
     }
     else
     {
         File.Delete("password.txt");
     }
     if (server.Login(userNameTextBox.Text, passwordTextBox.Text))
     {
         button4.Enabled             = true;
         deleteStringsButton.Enabled = true;
     }
 }
Пример #3
0
		public static void Main(string[] args)
		{
			if (args.Length == 3) {
				try {
					string userName, password;
					using (StreamReader r = new StreamReader("password.txt")) {
						userName = r.ReadLine();
						password = r.ReadLine();
					}
					TranslationServer server = new TranslationServer(new TextBox());
					if (!server.Login(userName, password)) {
						MessageBox.Show("Login failed");
						return;
					}
					server.AddResourceString(args[0], args[1], args[2]);
					MessageBox.Show("Resource string added to database on server");
					return;
				} catch (Exception ex) {
					MessageBox.Show(ex.ToString());
				}
			}
			Application.EnableVisualStyles();
			Application.Run(new MainForm());
		}
Пример #4
0
		void Button3Click(object sender, EventArgs e)
		{
			server = new TranslationServer(outputTextBox);
			if (savePasswordCheckBox.Checked) {
				using (StreamWriter w = new StreamWriter("password.txt")) {
					w.WriteLine(userNameTextBox.Text);
					w.WriteLine(passwordTextBox.Text);
				}
			} else {
				File.Delete("password.txt");
			}
			if (server.Login(userNameTextBox.Text, passwordTextBox.Text)) {
				button4.Enabled = true;
				deleteStringsButton.Enabled = true;
			}
		}