Unigui避免浏览器刷新要重新登录问题解决办法

办法是通过Cookie实现。

在Loginform登陆成功后,写入Cookie相关数据

    Self.Hide;
    UniApplication.Cookies.SetCookie('UserName', UniMainModule.Operat_Person);

这时候正常情况下,刷新后会显示登陆页面,只需要在Longin的OnShow事件中判断Cookie就可以了,如果Cookie有效,没有过期,检查之前写入的值,代码如下。

if UniApplication.Cookies.GetCookie('UserName')<>'' then
begin
   self.Hide;
   Main_form := TMainForm.Create(UniApplication);
   Main_form.Show;
end;

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Universal Data Access Components Source Code Copyright 1997-2009, Devart. All Rights Reserved There are two ways to compile and install UniDAC for Windows manually. I. Using IDE Delphi and C++ Builder for Win32 -------------------------------- Run your IDE and walk through folowing steps: 1) Compile DAC run-time package (dacXX.dpk) 2) For Delphi 6,7 or C++ Builder 6 compile DAC GUI related package dacvclXX.dpk 3) Compile DAC design-time package (dcldacXX.dpk) 4) Compile UniDAC run-time package (unidacXX.dpk) 5) For Delphi 6,7 or C++ Builder 6 compile UniDAC GUI related package unidacvclXX.dpk If you are going to create CLX applications compile UniDacClx.pas unit separately. 6) Compile and install UniDAC design-time package (dclunidacXX.dpk) You can find these packages in Source\Delphi5\*.dpk - for Delphi 5 Source\Delphi6\*.dpk - for Delphi 6 Source\Delphi7\*.dpk - for Delphi 7 Source\Delphi9\*.dpk - for Delphi 2005 Source\Delphi10\*.dpk - for Delphi 2006 Source\Delphi11\*.dpk - for Delphi 2007 Source\CBuilder5\*.bpk - for C++ Builder 5 Source\CBuilder6\*.bpk - for C++ Builder 6 To compile UniDAC based application add UniDAC Source directory path to the "Library Path". Delphi for .NET ----------------- Run your IDE and walk through folowing steps: 1) Compile DAC run-time package (Devart.Dac.dpk) 2) Compile DAC design-time package (Devart.Dac.Design.dpk) 3) Compile UniDAC run-time package (Devart.UniDac.dpk) 4) Compile and install UniDAC design-time package (Devart.UniDac.Design.dpk) 5) Specify the path to compiled assembles in "Assembly Search Paths" You can find these packages in Source\Delphi9\*.dpk - for Delphi 2005 Source\Delphi10\*.dpk - for Delphi 2006 To compile UniDAC based application add Devart.Dac and Devart.UniDac to Namespace prefixes, add UniDAC Source directory path to the "Library Path" list. II. Using make-files Delphi and C++ Builder for Win32 -------------------------------- 1) Go to one of the following folders (let's denote this folder %MakePath%): Source\Delphi5 - for Delphi 5 Source\Delphi6 - for Delphi 6 Source\Delphi7 - for Delphi 7 Source\Delphi9 - for Delphi 2005 Source\Delphi10 - for Delphi 2006 Source\Delphi11 - for Delphi 2007 Source\CBuilder5 - for C++ Builder 5 Source\CBuilder6 - for C++ Builder 6 2) Find in the 'Make.bat' line containing set IdeDir="D:\Program Files\Borland\Delphi7 and make sure that correct path to IDE is set (always include forward quote and do not include ending quote) 3) Run 'Make.bat'. Binaries will be copied to %MakePath%\UniDac subfolder 4) Copy %MakePath%\UniDac\*.bpl files to a folder that is included in the PATH environment variable 5) Run IDE and add dclunidacXX.bpl via Component->Install Packages... menu 6) To compile UniDAC based application add UniDAC Source directory path to the "Library Path" list Delphi for .NET ----------------- 1) Go to the following folders (let's denote this folder %MakePath%): Source\Delphi9 - for Delphi 2005 Source\Delphi10 - for Delphi 2006 2) Find in the 'Make.bat' line containing For Delphi 2005: set IdeDir="D:\Program Files\Borland\BDS\3.0 For Delphi 2006: set IdeDir="D:\Program Files\Borland\BDS\4.0 and make sure that correct path to IDE is set (always include forward quote and do not include ending quote) 3) Run 'Make.bat'. Binaries will be copied to %MakePath%\UniDac subfolder 4) Run IDE and add Devart.UniDac.Design.dll via Component->Installed .NET Components->.NET VCL Components->Add... menu. Specify the path to compiled assembles in Component->Assembly Search Paths->Add... menu 6) To compile UniDAC based application add Devart.Dac and Devart.UniDac to Tools->Options->Environment Options->Delphi Options->Library-> Namespace prefixes

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值