25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
1.6 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Configuration;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13. using Learun.Util;
  14. namespace Quanjiang.DigitalScholl.DataSync
  15. {
  16. public partial class Form2 : Form
  17. {
  18. public Form2()
  19. {
  20. InitializeComponent();
  21. }
  22. private void button1_Click(object sender, EventArgs e)
  23. {
  24. if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
  25. {
  26. if (this.folderBrowserDialog1.SelectedPath.Trim() != "")
  27. {
  28. this.textBox4.Text = this.folderBrowserDialog1.SelectedPath.Trim();
  29. DirectoryInfo name = new DirectoryInfo(this.folderBrowserDialog1.SelectedPath);
  30. FileInfo[] af = name.GetFiles();
  31. var bb = af.ToList();
  32. MainService service = new MainService();
  33. service.BeginSync(bb);
  34. }
  35. }
  36. }
  37. private void button2_Click(object sender, EventArgs e)
  38. {
  39. //写
  40. var opencon = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  41. opencon.ConnectionStrings.ConnectionStrings["source"].ConnectionString = this.mixtxt.Text.Trim();
  42. opencon.ConnectionStrings.ConnectionStrings["target"].ConnectionString = admtxt.Text.Trim();
  43. opencon.Save(ConfigurationSaveMode.Full);
  44. }
  45. }
  46. }