1.Tsplitter 如何横向分割?
<见2011.1.11>
2.获取本机IP的方法?
控件类 IPWatch
将IdWatch1的HistoryEnabled设置为False,在TForm1.FormCreate中添加如下代码:statBar1.Panels.Items[0].Text:=idpwtch1.LocalIP;
函数API类
function ComputerLocalIP: string;
var
ch: array[1..32] of char;
wsData: TWSAData;
myHost: PHostEnt;
i: integer;
begin
Result :='';
if WSAstartup(2,wsData)<>0then Exit; // can’t start winsock
try
if GetHostName(@ch[1],32)<>0then Exit; // getHostName failed
except
Exit;
end;
myHost := GetHostByName(@ch[1]); // GetHostName error
if myHost=nilthen exit;
for i:=1to4do
begin
Result := Result + IntToStr(Ord(myHost.h_addr^[i-1]));
if i<4then
Result := Result +'.';
end;
end;
3.