发新话题
打印

[原创+经验总结]首期闭关经验分享

本主题由 cdimp 于 2008-5-28 09:08 加入精华
引用:
原帖由 asilan 于 2008-5-20 17:22 发表
楼主离大牛不远了
路漫漫其修远兮....
支持 (0)  反对 (0)

TOP

引用:
原帖由 withy 于 2008-5-21 11:07 发表

参考网页:http://www.tune-up.com/company/

Made in China问题见前面的回复。
当然诚实中也要有善意的谎言,你可以说是一个由几个人组成的团队。
我网站就说是一个team
超级简单易用的音视频转换控件 2008.09.28 最新版本 2.2 推出,更强大 FFmpeg for Delphi http://www.CCAVC.com
MSN: CodeCoolie#live.com QQ: 25758206 (请填写相关验证信息, 谢谢)
成功上传头像的秘籍
支持 (0)  反对 (0)

TOP

期待中...
引用:
原帖由 withy 于 2008-5-21 10:58 发表

加家去整理一下就贴出来给大家。
目标:月入500刀!
支持 (0)  反对 (0)

TOP

很好,谢谢楼主
支持 (0)  反对 (0)

TOP

不好意思,这几天太忙,一直没空来灌水,按诺现将email收集的inno setup关键代码贴出来。惯例,涉及隐私部分...掉,勿怪。
[CustomMessages]
NewsletterForm_Caption=Newsletter Subscription
NewsletterForm_Description=窗口描述
NewsletterForm_Label1_Caption0=定阅描述
NewsletterForm_Label2_Caption0=Email:
NewsletterForm_CheckBox1_Caption0=I agree to receive the e-mail newsletter. (Optional)

[Code]
var
  EmailPage : TWizardPage;
  Label1: TLabel;
  Label2: TLabel;
  Edit1: TEdit;
  CheckBox1: TCheckBox;

procedure CurPageChanged(CurPageID: Integer);
var i: LongInt;
begin
  if (CurPageID = EmailPage.ID) then
    if edit1.text='' then
      WizardForm.NextButton.Enabled := not checkbox1.checked
    else
      WizardForm.NextButton.Enabled := true;
end;
{ NewsletterForm_Activate }

procedure NewsletterForm_Activate(Page: TWizardPage);
begin
  //
end;

{ NewsletterForm_ShouldSkipPage }

function NewsletterForm_ShouldSkipPage(Page: TWizardPage): Boolean;
begin
  Result := False;
end;

{ NewsletterForm_BackButtonClick }

function NewsletterForm_BackButtonClick(Page: TWizardPage): Boolean;
begin
  Result := True;
end;

{ NewsletterForm_checkbox1click}

procedure NewsletterForm_checkbox1click(Sender: TObject);
begin
  edit1.enabled := checkbox1.checked;
  if edit1.text='' then
    WizardForm.NextButton.Enabled := not checkbox1.checked
  else
    WizardForm.NextButton.Enabled := true;
end;

procedure NewsletterForm_edit1change(Sender: TObject);
begin
  if edit1.text<>'' then
    WizardForm.NextButton.Enabled := true
   else
    WizardForm.NextButton.Enabled := false;
end;

{ NewsletterForm_NextkButtonClick }

//判断是否合法的email地址,不是很完美,可惜不知道怎么在inno setup里用正则表达式,不然就可以做个比较完美的判断的。
function isemail(email:string):boolean;
var
  i:integer;
  tmp:string;
begin
  result:=false;
  i:=pos('@',email);
  if (i>0) then
  begin
    tmp:=copy(email,i+1,Length(email));
    if pos('.',tmp)>0 then
      result:=true;
  end;
end;

function NewsletterForm_NextButtonClick(Page: TWizardPage): Boolean;
var
  ResultCode: Integer;
begin
  if CheckBox1.checked then
  begin
    if isemail(Edit1.text) then
    begin
      //将email加入邮件列表的代码,由于涉及隐私,固...掉,可根据自己的邮件列表管理方式进行发挥
      ...
      Result := True;
    end
    else begin
      MsgBox('Invalid email address! Please re enter your email.',
       mbError, MB_OK);
      result := False;
    end;
  end
  else result := True;
end;

{ NewsletterForm_CancelButtonClick }

procedure NewsletterForm_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean);
begin
  // enter code here...
end;

{ NewsletterForm_CreatePage }

function NewsletterForm_CreatePage(PreviousPageId: Integer): Integer;
begin
  EmailPage := CreateCustomPage(
    PreviousPageId,
    ExpandConstant('{cm:NewsletterForm_Caption}'),
    ExpandConstant('{cm:NewsletterForm_Description}')
  );

{ Label1 }
  Label1 := TLabel.Create(EmailPage);
  with Label1 do
  begin
    Parent := EmailPage.Surface;
    Caption := ExpandConstant('{cm:NewsletterForm_Label1_Caption0}');
    Left := ScaleX(8);
    Top := ScaleY(8);
    Width := ScaleX(391);
    Height := ScaleY(37);
    AutoSize := False;
    WordWrap := True;
  end;

  { Label2 }
  Label2 := TLabel.Create(EmailPage);
  with Label2 do
  begin
    Parent := EmailPage.Surface;
    Caption := ExpandConstant('{cm:NewsletterForm_Label2_Caption0}');
    Left := ScaleX(64);
    Top := ScaleY(81);
    Width := ScaleX(28);
    Height := ScaleY(13);
  end;

  { Edit1 }
  Edit1 := TEdit.Create(EmailPage);
  with Edit1 do
  begin
    Parent := EmailPage.Surface;
    Left := ScaleX(104);
    Top := ScaleY(79);
    Width := ScaleX(217);
    Height := ScaleY(21);
    TabOrder := 0;
    OnChange := @NewsletterForm_edit1change;
  end;

  { CheckBox1 }
  CheckBox1 := TCheckBox.Create(EmailPage);
  with CheckBox1 do
  begin
    Parent := EmailPage.Surface;
    Caption := ExpandConstant('{cm:NewsletterForm_CheckBox1_Caption0}');
    Left := ScaleX(10);
    Top := ScaleY(208);
    Width := ScaleX(321);
    Height := ScaleY(17);
    State := cbChecked;
    TabOrder := 1;
    OnClick := @NewsletterForm_checkbox1click;
  end;

  with EmailPage do
  begin
    OnActivate := @NewsletterForm_Activate;
    OnShouldSkipPage := @NewsletterForm_ShouldSkipPage;
    OnBackButtonClick := @NewsletterForm_BackButtonClick;
    OnNextButtonClick := @NewsletterForm_NextButtonClick;
    OnCancelButtonClick := @NewsletterForm_CancelButtonClick;
  end;

  Result := EmailPage.ID;
end;

{ NewsletterForm_InitializeWizard }

procedure InitializeWizard();
begin
  NewsletterForm_CreatePage(wpLicense);
end;
本帖最近评分记录
  • edwinyeah 活力 +10 精品文章 2008-7-29 18:10
  • 失忆 活力 +10 原创精品,再+ 2008-7-17 16:29
  • 扫地老僧 活力 +10 2008-7-17 06:43
  • cdimp 活力 +15 2008-6-7 18:05
  • cdimp 财富 +10 2008-6-7 18:05
支持 (0)  反对 (0)

TOP

不错,楼主总结得很有道理!!!
支持 (0)  反对 (0)

TOP

楼主很厚道,赞一个
支持 (0)  反对 (0)

TOP

很实用,收藏
支持 (0)  反对 (0)

TOP

引用:
原帖由 bubu123 于 2008-7-16 15:21 发表
很实用,收藏
支持 (0)  反对 (0)

TOP

支持楼主一个

支持 (0)  反对 (0)

TOP

发新话题