unitconst.pas

来自「Mailserver Source code - Delphi. Simp」· PAS 代码 · 共 67 行

PAS
67
字号
unit UnitConst;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, ExtCtrls, ComCtrls,server_TLB,ComObj, StdCtrls,inifiles;

procedure  C_SaveMailData(Astr:string);
function   C_GetMailUserID(AMailStr:string):string;
procedure  C_SetCombox(AStr:string;AComboBox:TComboBox);

implementation

procedure C_SetCombox(AStr:string;AComboBox:TComboBox);
var
  MyList:TStringList;
begin
  MyList:=TStringList.Create;
  try
    MyList.Text:=AStr;
    AComboBox.Clear;
    AComboBox.Items.AddStrings(MyList);
    if MyList.Count>0 then
    begin
      AComboBox.ItemIndex:=0;
    end;
  finally
    MyList.Free;
  end;
end;

function C_GetMailUserID(AMailStr:string):string;
var
  i:integer;
begin
  i:=pos('@',AMailStr);
  if i<>0 then
  begin
    result:=copy(AMailStr,1,i-1);
  end
  else begin
    result:=AMailStr;
  end;
end;

//保存邮件----------------------------------------------------------------------
procedure C_SaveMailData(Astr:string);
var
  MyList:TStringList;
  MyPathName: array[0..255] of Char;
  MyFilePath:string;
begin
  MyList:=TStringList.Create;
  try
    gettemppath(255, @MyPathName);
    MyFilePath:=MyPathName+'\_temp.eml';
    MyList.Text:=Astr;
    MyList.SaveToFile(MyFilePath);
  finally
    MyList.Free;
  end;
end;
//------------------------------------------------------------------------------

end.

⌨️ 快捷键说明

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