1、我的软件有一个用户登陆,我想按照等级让一部分人只能实现其中的一部分动能,请问怎么去实现。
2、怎么在DELPHI中修改系统(电脑的)日期和时间。

解决方案 »

  1.   

    1。按等级设定不同的密码,根据登陆的密码来确定某些功能的Enable与Disable
    2 var
        YourDate:TDate;
        YourString:String;  //  2003-11-20 或者03-11-20 的格式
        YourTime:TTime;    //   18:20:30 的格式
        newtime:TDateTime; YourDate:=StrToDateTime(YourString);
     with newtime do
      begin
        wYear:=   Yearof(YourDate);
        wMonth:=  Monthof(YourDate);
        wDay:=    Dayof(YourDate);
        wHour:=   Hourof(YourTime);
        wMinute:= Minuteof(YourTime);
        wSecond:= Secondof(YourTime);
      end;
      SetLocalTime(newtime);    //  修改系统时间和日期
      

  2.   

    修改系统日期和时间procedure TForm1.Button3Click(Sender: TObject);
    var MyST:TSystemTime;
    begin
      MyST.wYear:=2000;
      MyST.wMonth:=4;
      MySt.wDay:=1;
      MySt.wHour:=17;
      MySt.wMinute:=20;
      MySt.wSecond:=20;
      if SetSystemTime(MyST) then ShowMessage('Change successfully')
      else ShowMessage('Change failed');
    end;