Пример #1
0
        /// <summary>
        /// 此操作需要管理员权限
        /// </summary>
        static DD_ACtion()
        {
            dd = new CDD();
            string path = "Dll\\DD81200x64.32.dll";

            if (!LoadDllFile(path))
            {
                throw new Exception();
            }
        }
Пример #2
0
        static bool LoadDllFile(string dllfile)
        {
            dd = new CDD();
            System.IO.FileInfo fi = new System.IO.FileInfo(dllfile);
            if (!fi.Exists)
            {
                System.Windows.Forms.MessageBox.Show("文件不存在");
                return(false);
            }
            int ret = dd.Load(dllfile);

            if (ret == -2)
            {
                System.Windows.Forms.MessageBox.Show("装载库时发生错误"); return(false);
            }
            if (ret == -1)
            {
                System.Windows.Forms.MessageBox.Show("取函数地址时发生错误"); return(false);
            }
            if (ret == 0) /*System.Windows.Forms.MessageBox.Show("非增强模块"); */ } {