procedure TForm1.FormCreate(Sender: TObject);var
SN : pdword; a, b : dword; Buffer : array [0..255] of char;  zhuce : String;begin
  if GetVolumeInformation('d:\', Buffer, SizeOf(Buffer), SN, a, b, nil, 0) then zhuce := IntToStr(SN^);
  if StrToInt(zhuce) = 4589564553 then 
     begin
         if not assigned(form2) then form2 := TForm2.create(self);
         Form2.Show;
     end
  else Label1.Caption := '欢迎您';end;

解决方案 »

  1.   

    不能使用,这个程序换上按钮控件就能正常使用,但使用procedure TForm1.FormCreate(Sender: TObject);就不行了。procedure TForm1.Button1Click(Sender: TObject);//一换上这个就不行了procedure TForm1.FormCreate(Sender: TObject);var
    SN : pdword; a, b : dword; Buffer : array [0..255] of char;  zhuce : String;begin
      if GetVolumeInformation('d:\', Buffer, SizeOf(Buffer), SN, a, b, nil, 0) then zhuce := IntToStr(SN^);
      if StrToInt(zhuce) = 539564553 then Form2.Show
      else Label1.Caption := '欢迎您';end;
      

  2.   

    很抱歉,由于我刚刚学习DELPHI才几天,有很多东西不懂,能不能说的更清楚些,怎样放在
    FormShow里,谢谢了。