⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program.cs

📁 一个通讯录源码,用C#写的.挺不错的,大家可以参考看一下.
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;

namespace AddressList
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Assembly assem = Assembly.GetExecutingAssembly();        


            // Create an object from the assembly, passing in the correct number
            // and type of arguments for the constructor.
            //Object o = assem.CreateInstance("Example", false,
            //    BindingFlags.ExactBinding,
            //    null, new Object[] { 2 }, null, null);

            // Make a late-bound call to an instance method of the object.    
            //MethodInfo m = assem.GetType("Example").GetMethod("SampleMethod");
            //Object ret = m.Invoke(o, new Object[] { 42 });
            

            //fmLogin login = new fmLogin();
            
            //取得类型 
            Type objType = assem.GetType("AddressList.Forms.fmLogin", true, true); 
            //Type objType = Type.GetType("AddressList.fmLogin"); 
            //定义构造函数信息
            ConstructorInfo objCtor = objType.GetConstructor(Type.EmptyTypes);//Type.EmptyTypes

            //调用构造函数,并把返回结果强转为Form
            Form login = (Form)objCtor.Invoke(null);

            if (login != null)
            {
                login.ShowDialog();
                if (login.DialogResult == DialogResult.Yes)
                    Application.Run(new Forms.fmAddressData());
            }
            else
                Application.Exit();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -