securedformunit.cpp

来自「SecurityLib一个user-rights系统控件」· C++ 代码 · 共 44 行

CPP
44
字号
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "SecuredFormUnit.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"


//---------------------------------------------------------------------------
__fastcall TSecuredForm::TSecuredForm(TComponent* Owner)
	: TForm(Owner), FOnRightsRead(0) , Rights()
{
	ReadRights();
}

__fastcall TSecuredForm::TSecuredForm(TComponent* Owner, char *name)
	: TForm(Owner), FOnRightsRead(0), Rights(name)
{
	ReadRights();
}


void __fastcall TSecuredForm::ReadRights() {
	if (Rights.Binded() && (Rights.Logged() || Rights.AutoLogin()) )
		Rights.GetRight(Name.c_str());

//	if (!Rights.Logged())
//		throw Exception("Login Failed");

// if you want your application to quit when no login occured, close it in constructor


	RightsRead();

}
void __fastcall TSecuredForm::RightsRead() {
	if (FOnRightsRead) FOnRightsRead(this);
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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