你的帖子没咨询看,针对你提的“反射dll”给你一个例子/// <summary>
        /// 模糊查询
        /// </summary>
        /// <param name="ParentForm">父窗体</param>
        public static string FuzzyQuery(Form ParentForm)
        {
            Form _CurrentForm = (Form)Assembly.Load("SMSSystem.Query").CreateInstance("SMSSystem.Query.FRM_FuzzyQuery");
            _CurrentForm.ShowDialog(ParentForm);
            string _Result = _CurrentForm.GetType().GetProperty("CustomerNO").GetValue(_CurrentForm, null).ToString();
            return _Result;
        }

解决方案 »

  1.   

    sdr["DllName"]是什么内容,错误是找不到文件
      

  2.   

    我写了一个封装了窗体的DLL,非常简单using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace DLL封装窗体
    {
        [ComVisible(true)]
        public class WinFormDLL
        {
            public void showForm()
            {
                Form1 FRM = new Form1();
                FRM.Show();
            }
        }
    }
    然后在数据库中记录了dll名称,类名称,方法名称。
    希望能通过反射把窗体调用出来。
      

  3.   

    文件“D:\\DLL封装窗体.dll”存在当前电脑上吗?
      

  4.   

     Assembly sb = Assembly.LoadFile(Convert.ToString(sdr["DllName"])); 
      

  5.   

    对了,版主,我问一下,.net写的DLL必须要引用,才能反射吗?
      

  6.   

    看看FClssName,FFunction对不对,最好是单步跟踪看哪个报的错
      

  7.   


    namespace DLL封装窗体
    {
        [ComVisible(true)]
        public class WinFormDLL
        {
            public void showForm()
            {
                Form1 FRM = new Form1();
                FRM.Show();
            }
        }
    }
    public的
      

  8.   

    FClssName,FFunction 的值是什么?DLL封装窗体.WinFormDLLshowForm
      

  9.   

    FClssName是WinFormDLL
    FFunction 是showForm
    这个DLL中封装了Form1
      

  10.   

    FClssName 是方法fullname "DLL封装窗体.WinFormDLL"