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

📄 login.cpp

📁 软件工程
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "gggl.h"
#include "login.h"
#include "guanliyuan.h"
#include "SS_sy.h"
#include "SSwh.h"
#include "yh.h"
#include"add_baojin.h"
#include"add_bj.h"
#include"add_zh.h"
#include"cx_baojin.h"
#include"cxbj.h"
#include"zh_bj.h"
#include"zh_gl.h"
#include"zh_jfgl.h"
#include"zh_jl.h"
#include"zh_liulan.h"
#include"zh_xx.h"
#include"zh_zlgl.h"
#include "mima_gg.h"
#include"fcntl.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tlog *log;
//---------------------------------------------------------------------------
__fastcall Tlog::Tlog(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------


void __fastcall Tlog::Button2Click(TObject *Sender)
{ int i,n;
  AnsiString s;
  FILE *fp;
  char x[16];
  if(FileExists("fabu")==0)
  {fp=fopen("fabu","w+");
   fclose(fp);
   }
 fp=fopen("admin.txt","r");
 if(leixing1->Items->Strings[leixing1->ItemIndex] == "普通用户")
     {
       cx_bj1->Edit8->Text = log->name->Text;
       zh_xx1->Edit1->Text = log->name->Text;
       zh_jfgl1->Edit38->Text = log->name->Text;
       yh1->notic->Lines->LoadFromFile("fabu");
       yh1->Show();
       }
   else
     if(leixing1->Items->Strings[leixing1->ItemIndex] == "管理员用户")
        { fscanf(fp,"%s",x);
          if(log->name->Text == "admin")
            { n=open("admin.txt",O_RDONLY);
              s=x;
               if(filelength(n)==0&&log->password->Text=="")
                 { fclose(fp);
                   ShowMessage("初始化管理员密码");
                   mimagg->Show();
                   log->password->Text="";
                   close(n);
                  return;
                   }
                else
              {
               if (log->password->Text==s)
                   {  gggl1->Show();
                      guanliyuan1->Show();
                      log->password->Text="";
                     }
                 else
                    {
                  ShowMessage("请核对用户名和密码");
                  log->password->Clear();
                  log->name->Clear();
                     }
               }
         }
         }
     else
      ShowMessage("请选择你的用户类型");
      fclose(fp);

}
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------




⌨️ 快捷键说明

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