WinMain.cs 852 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace TestCad
  11. {
  12. public partial class WinMain : Form
  13. {
  14. public WinMain()
  15. {
  16. InitializeComponent();
  17. }
  18. private void button1_Click(object sender, EventArgs e)
  19. {
  20. ConnectToAcad.Connect(textBox1.Text);
  21. this.Close();
  22. }
  23. private void button2_Click(object sender, EventArgs e)
  24. {
  25. OpenFileDialog dialog=new OpenFileDialog();
  26. dialog.Filter = "CAD文件|*.dwg";
  27. if (dialog.ShowDialog() == DialogResult.OK)
  28. {
  29. textBox1.Text = dialog.FileName;
  30. }
  31. }
  32. }
  33. }