惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 小洋房

防止中文程序在英文系统上乱码 [Delphi] 快速获取文件大小 SQL Server2005中四种排名函数的使用 Delphi字符串函数大全 DateUtils-Function 用Delphi创建服务程序 - 小洋房 - 博客园 由图像的灰度化看基本图像处理 [转摘]Indy10,采用线程,发送电子邮件 如何过XP的防火墙而不被拦截 安装MSDE 2000 自动安装SQL Server数据库 现有 Delphi 项目迁移到 Tiburon 中的注意事项 Delphi中的字符串(转) Delphi之通过崩溃地址找出源代码的出错行 Playing With System Using Delphi Format函数详解 更改Delphi系统的默认字体 delphi指针 关于基础类数据结构的设计想法
判断SQL SERVER 服务是否断开
小洋房 · 2006-05-11 · via 博客园 - 小洋房

unit DTDem;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Psock, NMDayTim, ExtCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    NMDayTime1: TNMDayTime;
    Button1: TButton;
    Label3: TLabel;
    StatusBar1: TStatusBar;
    procedure Button1Click(Sender: TObject);
    procedure NMDayTime1Connect(Sender: TObject);
    procedure NMDayTime1Disconnect(Sender: TObject);
    procedure NMDayTime1HostResolved(Sender: TComponent);
    procedure NMDayTime1Status(Sender: TComponent; Status: String);
    procedure NMDayTime1ConnectionFailed(Sender: TObject);
    procedure NMDayTime1InvalidHost(var handled: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
  StdCap = 'The Current Date and Time is : ';

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  NMDayTime1.ReportLevel := Status_Basic;  //控制数量,Status_Basic=2。
  NMDayTime1.TimeOut := 300;  //控制时间,以毫秒为单位。
  NMDayTime1.Host := Edit1.Text;  //主机的名称或远程主机的IP地址。
  NMDayTime1.Port := StrToInt(Edit2.Text); //主机的端口。
  Label3.Caption := StdCap+NMDayTime1.DayTimeStr;//显示时间。
end;
//连接远程主机,此事件发生。
procedure TForm1.NMDayTime1Connect(Sender: TObject);
begin
  StatusBar1.SimpleText := 'Connected';     //显示连接
end;
//和远程的主机没连接上,此事件发生。
procedure TForm1.NMDayTime1Disconnect(Sender: TObject);
begin
  If StatusBar1 <> nil then
    StatusBar1.SimpleText := 'disconnected'; //显示断开连接。
end;
//当远程的主机地址被断然拒绝,此事件发生。
procedure TForm1.NMDayTime1HostResolved(Sender: TComponent);
begin
  StatusBar1.SimpleText := 'Host resolved';
end;
//一些状态改变时,此事件发生。
procedure TForm1.NMDayTime1Status(Sender: TComponent; Status: String);
begin
  If StatusBar1 <> nil then
    StatusBar1.SimpleText := status;
end;
//连接失败,此事件发生。
procedure TForm1.NMDayTime1ConnectionFailed(Sender: TObject);
begin
  ShowMessage('Connection Failed');
end;
//主机出毛病,此事件发生。
procedure TForm1.NMDayTime1InvalidHost(var handled: Boolean);
var
  TmpStr: String;
begin
  If InputQuery('Invalid Host!', 'Specify a new host:', TmpStr) then
  Begin
    NMDayTime1.Host := TmpStr;
    Handled := TRUE;
  End;
end;

end.
要使用TNMDayTime控件。
AdoQquery1.Sort = '字段名称 ASC'