Delphi

Delphi

Delphi通过IdSmtp发送邮件的简单代码

25 0

var smtp: TIdSMTP; MgeSend: TIdMessage;procedure TForm1.Button1Click(Sender: TObject);begin SMTP.Host:='smtp.163.com'; smtp.Username:='xxxx@163.com'; smtp.Password:='paswrd'; smtp.Port:=25; smtp.Connect(); MgeSend.Recipient

Delphi

Delphi 下载并运行的代码

34 0

uses UrlMon;{ --------下载并运行 -----------}procedure DownloadExec(lpUrl: PChar);var sUrl, sFile : string;begin sUrl := lpUrl; sFile := FormatDateTime('yyyyMMddhhmmss.', now) + copy(sUrl, Length(sUrl) - 2, Length(sUrl)); UrlDownloadToFil

Delphi 获取CPU Monitor使用率
Delphi

Delphi 获取CPU Monitor使用率

50 0

unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils,System.StrUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;type TForm1 = class(TForm) Label1: TLabel;

Delphi

Delphi 很方便调用的Log日志方法

62 0

procedure WriteLog(const Info: string);var Stream: TFileStream; FileName: string; Msg: string; P: PChar;begin FileName := ExtractFilePath(ParamStr(0)) + 'Log\' + FormatDateTime('YYYYMMDD', Now) + '_' + ExtractFileName(C

Delphi

Delphi IOS 保持设备开机状态

32 0

uses iOSapi.UIKit;procedre SetSleep(Enable:Boolean); var UIApp : UIApplication; begin UIApp := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication); UIApp.setIdleTimerDisabled(Enable); //Change it to false on app close e

Delphi

Delphi 获取文件大小根据显示GB MB KB B

47 0

function GetFileSize(const FileName : string): DWORD;var f : integer;begin f := FileOpen(FileName, fmOpenRead); try Result := Windows.GetFileSize(f, nil); finally FileClose(f); end; if Result = $FFFFFFFF then Result := 0;end; function CalcFil

Delphi

Delphi 比较两个日期是否大于N天

30 0

uses DateUtils;//比较两个日期是否大于20天function Comparisondate(t1,t2:TDateTime): Boolean;beginresult:=false;if DaysBetween(t1,t2)>20 thenbeginresult:=True;end;end;