private void button1_Click(object sender, EventArgs e) { try { double a, b, c; a = Convert.ToDouble(textBox2.Text); b = Convert.ToDouble(textBox3.Text); c = Convert.ToDouble(textBox1.Text); ClassLibrary2.Class1 cc = new ClassLibrary2.Class1(a, b, c); textBox7.Text = cc.clac().ToString(); } catch (Exception ex) { using (FileStream fs = File.Open(Resource1.log, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)) { using (StreamWriter sw = new StreamWriter(fs)) { sw.WriteLine(ex.Message); sw.WriteLine(ex.TargetSite); sw.WriteLine(ex.StackTrace); sw.WriteLine(ex.InnerException); sw.WriteLine(ex.HResult); sw.WriteLine(DateTime.Now); sw.Flush(); sw.Close(); } fs.Close(); } } }
private void button1_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { try { System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart((o) => { ClassLibrary2.Class1 c = new ClassLibrary2.Class1(); c.Search(folderBrowserDialog1.SelectedPath + "\\", out str, comboBox1.SelectedItem.ToString()); listBox1.Items.AddRange(str); listBox1.SelectedIndex = 0; listBox1.SelectedIndexChanged += new EventHandler(ListBox1_SelectedIndexChanged); })); if (!t.IsAlive) { t.Start(); } } catch (UnauthorizedAccessException) { MessageBox.Show("未找到文件!"); } } }
public void test() { ClassLibrary1.Class1 cls1 = new ClassLibrary1.Class1(); ClassLibrary2.Class1 cls2 = new ClassLibrary2.Class1(); cls1.Display(); cls2.Display(); }
protected void Page_Load(object sender, EventArgs e) { ClassLibrary1.Class1 class1 = new ClassLibrary1.Class1(); ClassLibrary2.Class1 class2 = new ClassLibrary2.Class1(); ClassLibrary3.Class1 class3 = new ClassLibrary3.Class1(); Response.Write(Session["TEST"].ToString()); Response.Write(Session["TEST2"].ToString()); Response.Write(class1.Test()); Response.Write(class2.Test()); Response.Write(class3.Test()); }
static void Main(string[] args) { double a, b, c; Console.WriteLine("请输入三角形一边边长"); a = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("请输入三角形第二边边长"); b = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("请输入三角形夹角角度(角度制)"); c = Convert.ToDouble(Console.ReadLine()); ClassLibrary2.Class1 cclass = new ClassLibrary2.Class1(a, b, c); Console.WriteLine(cclass.clac().ToString()); double d, e, f; Console.WriteLine("请输入三角形一边边长"); d = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("请输入三角形第二边边长"); e = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("请输入三角形第三边边长"); f = Convert.ToDouble(Console.ReadLine()); ClassLibrary3.Class1 cc = new ClassLibrary3.Class1(d, e, f); Console.WriteLine(cc.clac().ToString()); Console.ReadKey(); }
private void button1_Click(object sender, EventArgs e) { ClassLibrary2.Class1 css = new ClassLibrary2.Class1(); Dic = css.Dic; }
static void Main(string[] args) { ClassLibrary2.Class1 x = new ClassLibrary2.Class1(); x.teste1(); }
public static extern void ShowMessage(string text);//动态链接库中方法 private void button1_Click(object sender, EventArgs e) { ClassLibrary2.Class1 I = new ClassLibrary2.Class1(); I.ShowMessage("弹框"); }
public MainWindow() { InitializeComponent(); ClassLibrary2.Class1 tmp = new ClassLibrary2.Class1(); tmp.Fire(); }
public Class1() { var obj = new ClassLibrary2.Class1(); }
public static void Main(string[] args) { var test1 = new ClassLibrary1.Class1(); var test2 = new ClassLibrary2.Class1(); }