Beispiel #1
0
 private void btntest2_Click(object sender, EventArgs e)
 {
     try
     {
         DynamicCallLib callLib = new DynamicCallLib("LibDotNet45", "Test", "readint");
         callLib.CallvoidMethod(new object[] { 76 });
     }
     catch (Exception ex)
     {
         tbMsg.AppendText(ex.Message + "\r\n");
     }
 }
Beispiel #2
0
 private void btntest4_Click(object sender, EventArgs e)
 {
     try
     {
         DynamicCallLib callLib = new DynamicCallLib("LibDotNet45", "Test", "resstring");
         string         res     = callLib.CallResMethod <string>(new object[] { "今天赚了多少钱?", 25.43f });
         tbMsg.AppendText("返回消息:" + res + "\r\n");
     }
     catch (Exception ex)
     {
         tbMsg.AppendText(ex.Message + "\r\n");
     }
 }
Beispiel #3
0
 private void btntest3_Click(object sender, EventArgs e)
 {
     try
     {
         DynamicCallLib callLib = new DynamicCallLib("LibDotNet45", "Test", "getint");
         int            qty     = callLib.CallResMethod <int>();
         tbMsg.AppendText("得到的返回数为" + qty + "\r\n");
     }
     catch (Exception ex)
     {
         tbMsg.AppendText(ex.Message + "\r\n");
     }
 }
Beispiel #4
0
 private void btntest1_Click(object sender, EventArgs e)
 {
     try
     {
         DynamicCallLib callLib = new DynamicCallLib("LibDotNet45", "Test", "getstring");
         string         resstr  = callLib.StaticCallResMethod <string>(new object[] { "我来试试" });
         tbMsg.AppendText(resstr + "\r\n");
     }
     catch (Exception ex)
     {
         tbMsg.AppendText(ex.Message + "\r\n");
     }
 }