//判断一个机器的MSSQL是否启动,通过SQL DMO是可以的,但对于没有装MSSQL的客户端来说就没办法,此处用的是连接MSSQL的1433端口,如果端口号不同,可以通过传递端口.
unit Judge_U;
interface
uses
SysUtils, Classes, IdBaseComponent, IdComponent, IdTCPConnection, IdIcmpClient,
IdTCPClient, IdRawBase, IdRawClient;
function JudgePort(AServerName: PChar; APort: Integer): Boolean;
function JudgePing(AServerName: PChar): Boolean;
implementation
function JudgePing(AServerName: PChar): Boolean;//这个是用来PIN计算机的.
var
ICMP: TIdIcmpClient;
b...[ 查看全文 ]