Beispiel #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());
 }
Beispiel #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;
     }
 }
Beispiel #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());
		}
Beispiel #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;
			}
		}